GSDP:GAM100/CProcessing/hsv2rgb()
< GSDP:GAM100 | CProcessing
hsv2rgb()
Description
Converts a HSV PColorHSV to an RGB PColor.
Parameters
hsv2rgb(PColorHSV hsv)
- hsv - (PColorHSV) The HSV value to convert to RGB.
Example
void init()
{
size(400, 400);
rectMode(CORNER);
}
void update()
{
background(color(0, 0, 0, 255));
PColorHSV hsv = colorHSV((frameCount * 3) % 360, 100, 50, 255);
fill(hsv2rgb(hsv));
rectRounded(10, 10, 380, 190, 20);
PColor rgb = color((int)((sinf(frameCount * 0.05f) + 1.0f) * 128.0f) % 256,
(int)((sinf(frameCount * 0.05f + 2.0f * PI / 3.0f) + 1.0f) * 128.0f) % 256,
(int)((sinf(frameCount * 0.05f + 4.0f * PI / 3.0f) + 1.0f) * 128.0f) % 256, 255);
fill(hsv2rgb(rgb2hsv(rgb)));
rectRounded(10, 210, 380, 190, 20);
}