Here's a tip on how to set the default value of a color property in the Visual Studio designer.
If you have a component that has a BackColor property, for example, and you want to indicate to the Property Grid that its default color is defined as the RGB values 255/255/192 (light yellow) then you might have some trouble. You can initialize a color at runtime from these RGB values by calling Color.FromArgb(255, 255, 192), but since there's no matching constant, you can't pass this into the DefaultValueAttribute constructor:
[DefaultValue(Color.FromArgb(255, 255, 192))] // Won't compile, needs a constant value
public Color BackColor { get { ... } set { ... } }
You can try using the overloaded constructor to pass in the type of the object and an initialization string that can be parsed by a TypeConverter (just as when you type it directly into the property grid), but for some reason I've yet to discover that won't work if you use the RGB values:
[DefaultValue(typeof(Color), "255; 255; 192")] // Won't work
The trick is to use the hexadecimal value of the RGB values as such:
[DefaultValue(typeof(Color), "0xFFFFC0")] // Works, 0xFF=255, 0xFF=255, 0xC0=192
Note that you can also define system or well-known colors like this:
[DefaultValue(typeof(Color), "Red")] // Works, Red=0xFF0000
Also, check out my post on specifying default values for enums.