GINO Graphics Suite - GINO v9.0  

gDefineHSV

Syntax

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

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

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

sat
Saturation, 0.0 to 1.0

value
Value, 0.0 to 1.0

Description

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

hue specifies the colour's position in the spectrum, sat specifies the departure of the colour from grey, and value specifies the departure of the colour from black. For zero saturation, the value value defines a grey-scale, irrespective of hue. If col is set to zero, it identifies the background colour. gDefineHSV() has no effect if the device does not allow variations of colour or intensity or if col is out of range for the device.

The action of gDefineHSV() depends on the colour capabilities of the device and whether gSetColourInfo() has been called. The default action is for gDefineHSV() 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, gDefineHSV() changes the values of a pseudo palette from which RGB values are extracted if colour indices are used in gSetLineColour().

The values sat and value 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 HSV 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

gDefineHSV Usage
gSetColourInfo