GINO Graphics Suite - GINO v9.0  

gDefineHLS

Syntax

[C/C++:]
void gDefineHLS(int col, float hue, float light, float sat);
[F90:]
subroutine gDefineHLS(col, hue, light, sat)

integer, intent(in) :: col
real, intent(in) :: hue,light,sat

Arguments

col
Colour index

< 0, Dummy definition
= 0, Background colour
> 0, Index up to device capability

hue
Hue angle in degrees, 0.0 to 360.0

= 0.0, Red
= 120.0, Green
= 240.0, Blue

light
Lightness, 0.0 (Black) to 1.0 (White)

sat
Saturation, 0.0 to 1.0

Description

The routine gDefineHLS() redefines the colour and intensity identified by col in terms of hue, lightness and saturation.

hue specifies the colour's position in the spectrum, light specifies the intensity of the colour on a linear scale from black (0.0) to white (1.0) and sat specifies the departure of the colour from grey. The most saturated colours occur when light is set to 0.5 and as light approaches either extreme all colours merge into black or white irrespective of the value of saturation. For zero saturation, lightness defines a grey-scale irrespective of hue. If col is set to zero, it identifies the background colour. gDefineHLS() has no effect if col is out of range for the device.

The action of gDefineHLS() depends on the colour capabilities of the device and whether gSetColourInfo() has been called. The default action is for gDefineHLS() to set a colour definition into a table indexed by col ready for being selected by the routine gSetLineColour(). If the device is operating in 24-bit direct-colour mode however, gDefineHLS() changes the values of a pseudo palette from which RGB values are extracted if colour indices are used in gSetLineColour().

light and sat are clipped to the range 0.0 to 1.0. If either value is clipped a warning message is output.

When using gDefineHSV() to change the colour of the background (col = 0) on static or true/direct colour devices, note that the colour change only takes effect at the next call to gNewDrawing() when the background is refreshed.

The HLS coordinates are converted to RGB before being transmitted to the device. Setting col less than zero stores the RGB values but does not transmit them to the device.

See Also

gDefineHLS Usage