FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version

make-hls

Arguments: &key hue lightness saturation

Returns an hls color object with the specified values for hue, lightness, and saturation. The values for hue, lightness, and saturation must be as follows:

Colors used must be RGB color objects

Note that the value of color properties (such as background-color and foreground-color) must be RGB color objects, as made with make-rgb. You should apply the function hls-to-rgb to an HLS color before setting a color property to it. You can use the function rgb-to-hls to get the HLS equivalent of an RGB color.

Translating to RGB causes roundoff

RGB colors (created with make-rgb) have values for red, green, and blue which are integers between 0 and 255 inclusive. Therefore, only 256*256*256 = 16,777,216 different RGB colors can be specified. Because HLS colors are specified with floats, apparently many more HLS colors can be specified (they are not all actually different, of course). Therefore, if you convert a HLS color to an RGB color (with hls-to-rgb), and then convert back with rgb-to-hls, the resulting hue, lightness, and saturation will likely differ from the originals by small amounts. The difference will be greater the smaller saturation and lightness are. A saturation of 0.0, means a shade of gray (with the hue having no effect) so converting such a color to RGB and back is likely to result in a very different hue.

See also make-rgb and hls-to-rgb, and hls-p, hls-hue, hls-saturation, and hls-lightness.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version