void DrawContents( TGrafPort& thePort ) const { TGArea area; GetAllocatedArea( area ); TGrafBundle aBundle( Copy ( TColorPaint::GetWhite() ), TAttributeState::kFill ); thePort.Draw( area.GetBounds(), aBundle ); }
So far, this manual has used TRGBColor in the examples. TRGBColor represents the red, green, and blue (RGB) color space, which is a fairly common color space that is used for most color monitors and color raster graphics systems.
The color values are type GIntensity, which gives you 32-bit precision for creating colors. You make the colors by combining red, green, and blue in various proportions as follows:
TXYZ is a universal, device-independent color space whose values are understood by everyone who works in color. All other Color framework color classes can transform into and out of this color space. Every color class has the ability to set itself equal to any other color class, and this ability enforces the transformation out of TXYZColor.
TGrayColor can take a single gray value such as 0.7 (which represents 70 percent gray), or you can map the values specified in any TColor instance passed to it to gray scale colors by taking the color values and converting them to a gray level.
THSVColor defines colors in terms of hue, saturation, and value (brightness). The hue, saturation, and value settings relate to the artistic concepts of tint, shade, and tone. You can adjust only one of the values and create different color effects. Values of THSVColor( 0,0,0 ) provide the least hue, saturation, and value (black); and values of THSVColor( 1,1,1 ) provide the greatest hue, saturation, and value (white). The values are all type GIntensity to give you 32-bit precision.
RGB color space
XYZ color space
Gray scale
HSV color space
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Generated with WebMaker