Reference Guide > H Routines > HLS Procedure
  

HLS Procedure
Standard Library procedure that generates and loads color tables into an image display device based on the HLS color system. The resulting color table is loaded into the display system.
Usage
HLS, ltlo, lthi, stlo, sthi, hue, lp[, rgb]
Input Parameters
ltlo—The starting color lightness or intensity, expressed as 0 to 100 percent. Full lightness (the brightest color) is 100 percent.
lthi—Ending color lightness or intensity, expressed as 0 to 100 percent.
stlo—The starting color saturation, expressed as 0 to 100 percent. Full saturation (undiluted or pure color) is expressed as 100 percent.
sthi—The ending color saturation, expressed as 0 to 100 percent.
hue—The starting hue, expressed as 0 to 360 degrees.
lp—The number of loops around the color cone. The value may be floating-point. A positive value will traverse the color cone in a clockwise direction; a negative value will traverse the color cone in a counterclockwise direction.
Output Parameters
rgb—(optional) A 256-by-3 integer output array containing the red, green, and blue vector values that were translated from the HSV system and loaded into the color tables. The following example shows the ordering of the RGB values in the output array:
Red_Vec(i) = RGB(i, 0)
Green_Vec(i) = RGB(i, 1)
Blue_Vec(i) = RGB(i, 2)
Keywords
None.
Discussion
The HLS procedure traces a spiral through the HLS color cone. Points along the spiral are converted from HLS values to RGB values and then loaded into the color tables with the TVLCT procedure. The color representation of pixel values between 0 and 255 is linearly interpolated from the hue, saturation, and lightness of the end points.
Example
The statement:
HLS, 0, 100, 50, 100, 0, -2.5
loads a color table that ranges from 0 to 100 percent in lightness or intensity and from 50 to 100 percent in saturation. This color table begins with a color of red, and makes two and a half full loops around the color solid in the direction of red to blue.
See Also
COLOR_CONVERT, HSV, LOADCT, MODIFYCT, RGB_TO_HSV, TVLCT, WgCeditTool, WgCtTool
For more information, see PV‑WAVE User’s Guide.
The HLS procedure is adapted from a program in Fundamentals of Interactive Computer Graphics by Foley and Van Dam, Addison Wesley Publishing Company, Reading, MA, 1982.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.