Set System.Drawing.Color values
You could create a color using the static FromArgb method:
Color redColor = Color.FromArgb(255, 0, 0);
You can also specify the alpha using the following overload.
The Color
structure is immutable (as all structures should really be), meaning that the values of its properties cannot be changed once that particular instance has been created.
Instead, you need to create a new instance of the structure with the property values that you want. Since you want to create a color using its component RGB values, you need to use the FromArgb
method:
Color myColor = Color.FromArgb(100, 150, 75);
You must use Color.FromArgb method to create new color structure
var newColor = Color.FromArgb(0xCC,0xBB,0xAA);