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

make-rgb Function

Summary

Returns a color specification in the red-green-blue model.

Package

color

Signature

make-rgb red green blue &optional alpha => color-spec

Arguments
red
A red component.
green
A green component.
blue
A blue component.
alpha
A number between 0 and 1, or nil.
Values
color-spec
A color specification.
Description

The function make-rgb returns a color-spec in the :rgb model with components red, green and blue.

Note that short floats are used for each component; this results in the most efficient color conversion process. However, any floating point number type can be used.

alpha indicates the alpha value of the color. 0 means it is transparent, 1 means it is solid. If alpha is nil or not specified then the color does not have an alpha component and it is assumed to be solid.

Examples

The object returned by the following call defines the color red in the RGB model:

CL-USER 25 > (color:make-rgb 1.0s0 0.0s0 0.0s0)
#(:RGB 1.0S0 0.0S0 0.0S0)
See also

make-hsv
make-gray
color-model
color-blue
color-level
color-alpha
15.1 Color specs


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:33:10