As already laid out on the Color Picker page colors are a fascinating area for me, particularly in conjunction with graphics and user interfaces. Colors have a lot of influence how a program is accepted and recognized. An important part of this area are precise color computations in order to reproduce colors correctly on different output devices. This is mainly the task of color management systems, but often enough it is pure overkill to involve a CMS just for good color determination. And here the Soft Gems color tools library comes into play. In addition, while a CMS is by nature more general in its working principle a library like these color tools can provide some very useful extra functionality.
What you will find in this library is:
- Common type definitions for various color formats, including gray scale, RGB, CMY(K), CIE L*a*b*, YCbCr, CIE XYZ, Y u'v' (k), HSV, HLS and Yxy.
- CIE XYZ color primaries for various "phosphors", including Apple RGB (Trinitron), SMPTE-C (CCIR 601-1), sRGB (HDTV), EBU/ITU (Pal/Secam), P22-EBU (Color Match RGB), Adobe RGB (1998), NTSC (1953), CIE RGB and Wide Gamut RGB (700/525/450nm).
- White point definitions:
Illuminant A (CIE) Incandescent illumination, yellow-orange in color, with a correlated color temperature of 2856K. It is defined in the wavelength range of 380 to 770nm. Illuminant B (CIE) Direct sunlight. Illuminant C (CIE) Tungsten illumination that simulates average daylight, bluish in color, with a correlated color temperature of 6774K. Illuminant D (CIE) Daylight illuminants, defined from 300 to 830nm (the UV portion 300 to 380nm being necessary to correctly describe colors that contain fluorescent dyes or pigments). They are designated as D, with a subscript to describe the correlated color temperature; D65 is the most commonly used, having a correlated color temperature of 6504K, close to that of illuminant C. They are based on actual measurements of the spectral distribution of daylight. Illuminant D55 (CIE) Cloudy daylight. D60 D65 D75 Illuminant E (CIE) Normalized reference source. Illuminant F2 (CIE) Fluorescent illuminant. F7 F11 9300K Illuminant with a color temperature of 9300K. Default of some old or low-quality CRT monitors, very bad for imaging.
- Predefined ink color sets, which are for instance used in CMYK conversions. These sets include AD-LITHO (Newsprint), Dainippon Ink, Eurostandard (Coated), Eurostandard (Newsprint), Eurostandard (Uncoated), SWOP (Coated), SWOP (Newsprint), SWOP (Uncoated), Toyo Inks (Coated Web Office), Toyo Inks (Coated), Toyo Inks (Dull coated) and Toyo Inks (Uncoated).
- Color conversion routines, like CMYK-to-RGB, RGB-to-XYZ or XYZ-to-Lab. The CMYK-to-RGB conversion routine is particularly interesting as it does not use the simple formulas involving complementary colors, but instead it implements the Yule-Nielsen Modified Neugebauer, which is very precise and nearly matches the results produced by Photoshop. Only color management systems can produce better results.
- Utility functions to brighten and darken colors, to compare two colors, to gamma correct a color and more.