

The 0-, 120-, and 240-degree values of hue represent the colors red, green, and blue, respectively. The hue component represents the position on the cone as an angular measurement. The HSV, sometimes called HSB (hue-saturation-brightness), and HLS color spaces can be thought of as single and double cones. Every other color available is represented somewhere between those corners. The corner indicated by (0, 0, 0) is black, and the opposite corner (255, 255, 255) is white. It can be thought of as a cube in which length indicates the intensity of red, width indicates the intensity of green, and height indicates the intensity of blue. The RGB color space is the most commonly used namespace in computer programming because it closely matches the structure of most display hardwarewhich commonly includes separate red, green, and blue subpixel structures.

To limit our discussion, we will cover the RGB (red-green-blue), HSV (hue-saturation-value), and HLS (hue-lightness-saturation) color spaces.

For example, RGB space is a three-dimensional space with red, green, and blue color channels. A color space contains components called color channels. Color spaces provide a common frame of reference that helps represent colors. It's hard for human beingsas perceptual entitiesto describe and represent colors. Chapter 9 discusses the alpha component in more detail (see Section 9.6). Real-world examples of alpha use include drawing translucent graphics shapes and images. An alpha value of 0 represents a fully transparent color, and a value of 255 represents a fully opaque color intermediate values produce results between these extremes. The alpha component (the first 8 bits) of the color represents transparency, which determines how a color is blended with the background. In GDI+, a color is represented by a 32-bit structure made up of four components: alpha (A), red (R), green (G), and blue (B), referred to as ARGB mode.
#GDIP COLORBOT HOW TO#
In this section we will examine color representation in GDI+ and how to use color-related functionality in real-world applications.
