ControlPaint.LightLight

I found this the other day and didn't have a chance to blog it at the time.

Imagine you're building a control and you want the developer to be able to specify the colour of some element on it (imagine something like a progress bar that shows a percentage value), but you want to accent other drawing elements of that controls in subtlely different colours.  For example, you might want to let the developer say that he/she wants a “RoyalBlue” progress bar, but to make it look a little nicer you want to use a graduated fill from a light blue to the blue he/she specifiies.

System.Windows.Forms.ControlPaint has a number of methods that let you get slightly different colours from a seed colour.  They are, and the name explains it all: DarkDark, Dark, Light and LightLight.

1 Comment

Comments have been disabled for this content.