Returns a color specification for a particular model.
color
ensure-rgb color-spec => result
ensure-hsv color-spec => result
ensure-gray color-spec => result
color-spec⇩ |
A color specification. |
result⇩ |
A color specification. |
The functions ensure-rgb
, ensure-hsv
and ensure-gray
each return a color specification matching the supplied color-spec, but in the appropriate model.
If color-spec is in the same model, it is just returned. Otherwise a new color specification for that model is calculated. Thus, ensure-rgb
returns a color specification in the RGB color model, whatever color model is used in color-spec.
If color-spec has an alpha component, then result has that same alpha component.
(ensure-hsv (make-rgb 1 1 0 0.75)) => #(:HSV 1 1 1 0.75)
(ensure-gray (make-rgb 0 0 1 0.75)) => #(:GRAY 0.33333302S0 0.75)
convert-color
colors=
ensure-color
ensure-model-color
15.3 Color models
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:33:10