Skip to content

format

typescript
Color.SetFromHSV(h, s, v)

class: Color

description

Set the color based on the hue, saturation, and value.

HSV (hue, saturation, value) is a commonly used way to represent colors. Unlike the RGB color model, it is easier to describe colors in a human-intuitive way.

Hue (H): Measured in degrees, ranging from 0° to 360°. It starts from red and goes counterclockwise, with red being 0°, green being 120°, and blue being 240°. The complementary colors are: yellow at 60°, cyan at 180°, and magenta at 300°.

Saturation (S): Ranging from 0.0 to 1.0.

Value (V): Ranging from 0.0 (black) to 1.0 (white).

parameter

param_nametypedescription
hnumberHue
snumberSaturation
vnumberValue

reture

typedescription
void

code example

typescript
let H = 0;
let S = 0.5;
let V = 0.5;
let color = new Color();
color.SetFromHSV(H,S,V);