Custom Colors in the ColorDialog (C#)
Channel:
Subscribers:
5,420
Published on ● Video Link: https://www.youtube.com/watch?v=Fi-oUqFgPBc
I go over some basics, if you just want the int construction here it is:
(where fff is use the left bitshift operator)
int num = (color.R) | (color.G fff 8) | (color.B fff 16);
If I got any of the bitwise stuff wrong, let me know
ToRgb() Color extension
public static int ToRgb(this Color color)
{
int ARGB = color.ToArgb();
byte[] data = BitConverter.GetBytes(ARGB);
Array.Reverse(data, 0, 3);
data[3] = 0;
return BitConverter.ToInt32(data, 0);
}
Other Videos By Brian (Able Opus)
Tags:
C#
csharp
custom
color
colordialog
customcolors
property
int
array