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)
CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017