Click here to Skip to main content
Click here to Skip to main content

Choose Color Dialog

, 7 Aug 2001
Rate this:
Please Sign up or sign in to vote.
This article demonstrates a tool for previewing foreground and background color combinations.
<!-- Download Links --> <!-- Article image -->

Sample Image - cclrdlg.gif

<!-- Main HTML starts here -->

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 looses 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

About the Author

PPresedo
Software Developer
United States United States
No Biography provided

Comments and Discussions

 
QuestionHow to change the Color Palatte of Gif File. Pinsusspubba6-Jul-04 17:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 8 Aug 2001
Article Copyright 2001 by PPresedo
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid