Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

ColorDlg

Revision
1.1

This class was built because I was fed up with enough color choosers that wouldn't give me the kind of choice I wanted. Though this is not really a class basically needed for a window manager, I found it necessary to include it here. After all one should be able to configure the looks of rwm as convenient as possible.
One especially convenient thing is the ability to work with an HSV as well as with an RGB color model at the same time.
Once started writing down the basics of this, I found out that QColor is not enough to hold the color descriptions I deem necessary. QColor is limited to 24 bits of color, that is 256 * 256 * 256 ~ 16.8 Mio colors. This is perfectly all right for RGB colors. HSV colors however cover 360 * 256 * 256 ~ 23.6 Mio colors. It is clear that there can not be an unambigous mapping between the two. So I decided to write my own rColor class as well, which saves the colors as HSV triplets and converts them to their RGB equivalents ( or aproximations ) only when and if necessary.
This class is better suited to work with color values than QColor is, but is not better than that. When it comes to actual drawing something, QColor is clearly better suited for that purpose. rColor has it's strength where designing a set of colors that fit together nicely is a goal.
I also took care to handle the alpha values in a sensible way, a functionality I often missed badly with other color dialogs I've come across.
Finally I integrated a color picker, in the end it is much easier and quicker to pick an existing color than define it from scratch.
Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for colordlg $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2