![]() |
|
|||||
|
Colors under .NET | |||||
ImageGlue uses a dedicated class for colors: Color. The Color class allows you to specify colors using component intensities as well as standard color names. |
||||||
|
RGB Colors | |||||
An RGB color specifies the intensity of the Red, Green and Blue components of a color. Imagine it as a set of three overlapping colored lights. Any color can be created using a combination of these lights. We specify the intensity as a number from 0 to 255. 0 indicates that the light is off, 255 that it is fully on. So:
|
||||||
|
RGBA Color Strings | |||||
An RGBA color is exactly the same as an RGB color but includes a fourth component Alpha, which is a measure of opacity. The alpha value is optional and defaults to 255 opaque (i.e. not transparent). You cannot generally draw with an RGBA Color but you may wish to determine the color and opacity of a point on a bitmap. |
||||||
|
Other Color Spaces | |||||
Most people will want to specify colors in the RGB color space. However the Color class supports multiple color spaces. If you want to use other color spaces like CMYK or grayscale you can do so using the Color.ColorSpace property. |
||||||
|
Color Components | |||||
The traditional RGB values lying between 0 and 255 are just that - tradition. The traditional CMYK values are specified as percentages - between 0 and 100 - again tradition. Ultimately these translate into floating point values between zero and one, indicating the intensity of the component. The Color class allows you access to the floating point component values if you need to represent 16 bit or high dynamic range colors. |