The QColor class provides colors based on RGB. (details) (complete member list)
#include <qcolor.h>
A color is normally specified in terms of RGB (red,green and blue) components, but it is also possible to convert from HSV (hue,saturation and value) or set a color name (X-Windows color database).
There are 19 predefined global QColor objects:
black,
white,
darkGray,
gray,
lightGray,
red,
green,
blue,
cyan,
magenta,
yellow,
darkRed,
darkGreen,
darkBlue,
darkCyan,
darkMagenta,
darkYellow,
color0
and
color1.
The colors color0
(pixel value = 0) and color1
(pixel value = 1) are
special colors for drawing in bitmaps.
The QColor class has an efficient, dynamic color allocation strategy. A color is normally allocated the first time it is used (lazy allocation), that is, whenever the pixel() function is called:
This method seems to work well even with thousands of allocated colors.
Constructs an invalid color with the RGB value (0,0,0). An invalid color is a color that is not properly set up for the underlying window system.
Constructs a color with the RGB value (r,g,b).
Constructs a color with a RGB value and a custom pixel value.
If the pix = 0xffffffff, then the color uses this RGB value in a standard way. If pix is something else, then the pixel value will be set directly to pix (skips the standard allocation procedure).
Constructs a named color.
See also: setNamedColor().
Constructs a color that is a copy of c.
Allocates a pixel value for the current RGB value.
Returns the blue component of the RGB value.
Returns the current RGB value as HSV.
Arguments:
See also: setHSV().
Returns the RGB value.
Gets the red, green and blue components of the RGB value.
See also: setRGB().
Returns the green component of the RGB value.
Returns TRUE if colors are allocated on-demand. The default setting is TRUE.
See also: setLazyAlloc().
Returns TRUE if this color has different RGB value from c, or FALSE if they have equal RGB values.
Returns TRUE if this color has the same RGB value as c, or FALSE if they have different RGB values.
Returns the pixel value.
Returns the red component of the RGB value.
Sets the RGB value to that of the named color.
This function searches the X color database for the color and sets the RGB value. The color will be set to invalid if such a color does not exist.
Sets the RGB value to (r,\e g,b).
See also: getRGB().
Writes a color object to the stream.
Format: RGB value serialized as UINT32.
Reads a color object from the stream.
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: