Introduction
I often wonder what color combinations will look like when selecting colors to use for a control. I also find myself wondering what the red, green, and blue values for an RGB value are. The Choose Color utility is meant to be used to preview foreground and background color selections as well as decode an RGB value into its red, green, and blue components.
To preview a color, just enter the red green values. To decode an RGB value into its red, green, and blue components, just enter an RGB value and leave the RGB edit control. When it loses the focus, the red, green, and blue values will be displayed for the entered RGB value.
The utility shows the common MFC example for handling the dynamic setting of the foreground and background colors for a control. If you view the ColorStatic.cpp file, you will see the implementation of the CColorStatic
class. It has member functions for setting the foreground and background color of the static control. The main workhorse of the class is the CtlColor
function.
License
This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.
A list of licenses authors might use can be found here.