(require 'color)
Returns #t if obj is a color. — Function: color? obj typ
Returns #t if obj is a color of color-space typ. The symbol typ must be one of:
- CIEXYZ
- RGB709
- L*a*b*
- L*u*v*
- sRGB
- e-sRGB
- L*C*h
Returns a color of type space.
- For space arguments
CIEXYZ,RGB709, andsRGB, the sole arg is a list of three numbers.- For space arguments
L*a*b*,L*u*v*, andL*C*h, arg is a list of three numbers optionally followed by a whitepoint.- For
xRGB, arg is an integer.- For
e-sRGB, the arguments are as fore-sRGB->color.
For colors in digital color-spaces,
color-precisionreturns the number of bits used for each of the R, G, and B channels of the encoding. Otherwise,color-precisionreturns #f
Returns the white-point of color in all color-spaces except CIEXYZ.
Converts color into space at optional white-point.
Each color encoding has an external, case-insensitive representation. To ensure portability, the white-point for all color strings is D65. 1
| Color Space | External Representation
|
| CIEXYZ | CIEXYZ:<X>/<Y>/<Z>
|
| RGB709 | RGBi:<R>/<G>/<B>
|
| L*a*b* | CIELAB:<L>/<a>/<b>
|
| L*u*v* | CIELuv:<L>/<u>/<v>
|
| L*C*h | CIELCh:<L>/<C>/<h>
|
The X, Y, Z, L, a, b, u, v, C, h, R, G, and B fields are (Scheme) real numbers within the appropriate ranges.
| Color Space | External Representation
|
| sRGB | sRGB:<R>/<G>/<B>
|
| e-sRGB10 | e-sRGB10:<R>/<G>/<B>
|
| e-sRGB12 | e-sRGB12:<R>/<G>/<B>
|
| e-sRGB16 | e-sRGB16:<R>/<G>/<B>
|
The R, G, and B, fields are non-negative exact decimal integers within the appropriate ranges.
Several additional syntaxes are supported by string->color:
| Color Space | External Representation
|
| sRGB | sRGB:<RRGGBB>
|
| sRGB | #<RRGGBB>
|
| sRGB | 0x<RRGGBB>
|
| sRGB | #x<RRGGBB>
|
Where RRGGBB is a non-negative six-digit hexadecimal number.
Returns the color represented by string. If string is not a syntactically valid notation for a color, then
string->colorreturns #f.
We experience color relative to the illumination around us. CIEXYZ coordinates, although subject to uniform scaling, are objective. Thus other color spaces are specified relative to a white point in CIEXYZ coordinates. The white point for digital color spaces is set to D65. For the other spaces a white-point argument can be specified. The default if none is specified is the white-point with which the color was created or last converted; and D65 if none has been specified.
Is the color of 6500.K (blackbody) illumination. D65 is close to the average color of daylight.
Is the color of 5000.K (blackbody) illumination. D50 is the color of indoor lighting by incandescent bulbs, whose filaments have temperatures around 5000.K.
[1] Readers may recognize these color string formats from Xlib. X11's color management system was doomed by its fiction that CRT monitors' (and X11 default) color-spaces were linear RGBi. Unable to shed this legacy, the only practical way to view pictures on X is to ignore its color management system and use an sRGB monitor. In this implementation the device-independent RGB709 and sRGB spaces replace the device-dependent RGBi and RGB spaces of Xlib.