RGBHLS - Converts a color specification given in the Red, Green, Blue (RGB) color space to color values
Contents
Access
To use RGBHLS or c_rgbhls, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in
that order.
C-Binding Description
The C-binding argument descriptions are the same as the FORTRAN argument descriptions.
C-Binding Synopsis
#include <ncarg/ncargC.h>
void c_rgbhls (float r, float g, float b, float *h,
float *l, float *s)
Copyright
Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
UNIX March 1993 RGBHLS(3NCARG)
Description
R (REAL, input, range [0.,1.]) represents the red intensity component of the input point in
RGB color space.
G (REAL, input, range [0.,1.]) represents the green intensity component of the input point in
RGB color space.
B (REAL, input, range [0.,1.]) represents the blue intensity component of the input point in
RGB color space.
H (REAL, output, range [0.,360.) ) represents the hue of the input point in HLS color space. A
value of (0.,0.,B) in the input space will result in a hue of 0. in the output space.
L (REAL, output, range [0.,100.]) represents the lightness value of the input point in HLS
color space. Lightness is a measure of the quantity of light - a lightness of 0. is black,
and a lightness of 100. gives white. The pure hues occur at lightness value 50.
S (REAL, output, range [0.,100.]) represents the saturation value of the input point in HLS
color space. Saturation is a measure of how much white light is mixed with the color.
Saturation values of 0. represent grays (with a gray value equal to the lightness value L).
Saturation values of 100. are fully saturated colors. The hue is undefined when S=0. The
fully saturated pure hues occur when S=100. and L=50. The saturation value should be thought
of as a percentage.
Examples
Use the ncargex command to see the following relevant examples: tcolcv, fcce02.
Messages
See the colconv man page for a description of all Colconv error messages and/or informational messages.
Name
RGBHLS - Converts a color specification given in the Red, Green, Blue (RGB) color space to color values
in the Hue, Lightness, Saturation (HLS) color space.
See Also
Online: colconv, hlsrgb, hsvrgb, rgbhsv, rgbyiq, yiqrgb, ncarg_cbind.
Hardcopy: NCAR Graphics Fundamentals, UNIX Version
Synopsis
CALL RGBHLS (R, G, B, H, L, S)
