GSDP:GAM100/CProcessing/CP ColorHSV Create()

From Inside
Jump to: navigation, search

CP_ColorHSV_Create()

Description

Create a CP_ColorHSV from given hue, saturation, value, and alpha values.

Parameters

CP_ColorHSV_Create(int h, int s, int v, int a)

  • h - (int) The hue of the color. Range of 0-360
  • s - (int) The saturation of the color. Range of 0-100.
  • v - (int) The value of the color. Range of 0-100.
  • a - (int) the alpha of the color. Range of 0-255.

Example

void update(void)
{
    // Get the current framecount and set the background to black
    int frameCount = CP_System_GetFrameCount();
    CP_Settings_Background(CP_Color_Create(0, 0, 0, 255));
    
    // Use framecount to slowly change the HSV color through all colors of the rainbow
    CP_ColorHSV hsv = CP_ColorHSV_Create((frameCount * 3) % 360, 100, 50, 255);
    CP_Settings_Fill(CP_Color_FromColorHSV(hsv));
    CP_Graphics_DrawRectAdvanced(10, 10, 380, 380, 0, 20);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>