rgb_or_hsv


Synopsis

convert colors between the rgb color cube and the hsv color cone

 

module rgb_or_hsv {
float r<NEportLevels={0x2,0x1}>;
float g<NEportLevels={0x2,0x1}>;
float b<NEportLevels={0x2,0x1}>;
float h<NEportLevels={0x2,0x1}>;
float s<NEportLevels={0x2,0x1}>;
float v<NEportLevels={0x2,0x1}>;
int mode; /* if mode == 0, rgb has priority if both change */
omethod+notify_val+notify_inst method_src = "rgb_or_hsv_proc";
};

Input Ports

h

Float. A value between 0 and 1 specifying hue.

s

A value between 0 and 1 specifying saturation.

v

A value between 0 and 1 specifying value.

r

Float. A value between 0 and 1 specifying red.

g

Float. A value between 0 and 1 specifying green.

b

Float. A value between 0 and 1 specifying blue.

Description

rgb_or_hsv converts between the red, green, blue (rgb) color cube and the hue, saturation, and value (hsv) color cone. For a description of the hsv color cone and rgb color cube, see See hsv_to_rgb .

If the rgb values are set, the hsv values are computed. If the hsv values are set, the rgb values are computed.

If rgb and hsv values are both set, the integer "mode" subobject establishes which values are computed:

•      If mode = 0, rgb is set

•      If mode = 1, hsv is set

File

v/gmod.v

See also

Related modules:

•      See hsv_to_rgb

•      See rgb_to_hsv