You can only assign const to a value that is a literal. In your case, I would prefer a string literal and define your color as follows:
const string mycolor = "Blue";
Then, wherever you need your color, you do the inverse transform:
Color mynewcolor = Color.FromName(mycolor);
Sorry, but this is the only way to keep it const .
EDIT . Alternatively, you can also save your color as (A) RGB attributes stored in a single int value. Note that you can use the hexadecimal literal to explicitly set the different components of your color (in the ARGB sequence):
const int mycolor = 0x00FFFFFF; Color mynewcolor = Color.FromArgb(mycolor);
Alexander Galkin
source share