All Manuals > CAPI User Guide and Reference Manual > 24 COLOR Reference Entries

ensure-color Function

Summary

Return a color specification in the model of a supplied color spec.

Package

color

Signature

ensure-color color-spec match-color-spec => result

Arguments
color-spec
A color specification.
match-color-spec
A color specification.
Values
result
A color specification.
Description

The function ensure-color returns a color specification for color-spec, in the color model of match-color-spec. This allows you to convert color specifications from one model to another with having to explicitly state the color model.

If color-spec has an alpha component, then result has that same alpha component.

Examples
(ensure-color (make-rgb 1 1 0 0.75) (make-hsv 0 0 0))
=>
#(:HSV 1 1 1 0.75)
See also

convert-color
colors=
ensure-model-color
15 The Color System


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:34:21