Next: Color Spaces, Previous: Color, Up: Color [Contents][Index]
(require 'color)
Returns #t if obj is a color.
Returns #t if obj is a color of color-space typ. The symbol typ must be one of:
Returns a color of type space.
CIEXYZ
, RGB709
, and
sRGB
, the sole arg is a list of three numbers.
L*a*b*
, L*u*v*
, and
L*C*h
, arg is a list of three numbers optionally followed
by a whitepoint.
xRGB
, arg is an integer.
e-sRGB
, the arguments are as for e-sRGB->color
.
Returns the symbol for the color-space in which color is embedded.
For colors in digital color-spaces, color-precision
returns the
number of bits used for each of the R, G, and B channels of the
encoding. Otherwise, color-precision
returns #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. 5
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 a string representation of color.
Returns the color represented by string. If string is not a
syntactically valid notation for a color, then string->color
returns #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.
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.
Next: Color Spaces, Previous: Color, Up: Color [Contents][Index]