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

NextPrevUpTopContentsIndex

color-to-premultiplied

Function
Summary

Transform a color to its premultiplied version.

Package

color

Signature

color-to-premultiplied color => result

Arguments

color

A color-spec.

Values

result

A color-spec.

Description

The function color-to-premultiplied transforms a color to its premultiplied version, which is needed when modifying images using Image Access.

color must be a color-spec, such as the result of a call to make-rgb (see Color specs).

If color does not have an alpha component, it is returned without a change. If it does have alpha, it is transformed to RGB if needed, and premultiplied, returning a premultiplied RGB color.

Notes

You need to premultiply when setting pixels using Image Access in an image with alpha. The result is unconverted, so when using image-access-pixel it still needs to be converted (by convert-color).

See also

color-from-premultiplied
image-access-pixel
image-access-pixels-to-bgra
image-access-pixels-from-bgra
Image access


CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017

NextPrevUpTopContentsIndex