All Manuals > CAPI Reference Manual > 3 COLOR Reference Entries

NextPrevUpTopContentsIndex

color-with-alpha

Function
Summary

Adds a specified alpha component to a color.

Package

graphics-ports

Signature

color-with-alpha color alpha => color-spec

Arguments

color

A color specification.

alpha

A real in the inclusive range [0,1].

Values

color-spec

A color specification, or nil .

Description

The function color-with-alpha returns a color like the argument color but with alpha component alpha .

color needs to be a color specification, either a keyword naming a color (a member of the result of calling get-all-color-names), or a color-spec (for example the result of make-rgb).

alpha must be a real in the inclusive range [0,1], otherwise an error is signaled. alpha = 0 means color-spec is transparent, alpha = 1 means it is solid.

color-with-alpha returns a color-spec, or nil if color is not recognized.

See also

get-all-color-names
make-rgb


CAPI Reference Manual - 15 Dec 2011

NextPrevUpTopContentsIndex