colorMode()
Color / SettingDescription
Changes the way Processing interprets color data. Default is RGB with range 0-255.
Syntax
void colorMode(int mode)
void colorMode(int mode, float max)
void colorMode(int mode, float mH, float mS, float mB, float mA)
Parameters
| Name | Type | Description |
|---|---|---|
| mode | int | RGB or HSB |
| max | float | range for all channels (optional) |
| mH | float | range for hue |
| mS | float | range for saturation |
| mB | float | range for brightness |
| mA | float | range for alpha |
Returns
voidRelated
Under the Hood
From Processing.h:
void colorMode(int mode, float mx=255.f);
void colorMode(int mode, float mH, float mS, float mB, float mA=255.f);
int colorMode;
Under the Hood
From Processing.cpp:
void PApplet::colorMode(int mode, float mx) { colorModeVal=mode; colorMaxH=colorMaxS=colorMaxB=colorMaxA=mx; }
void PApplet::colorMode(int mode, float mH, float mS, float mB, float mA) { colorModeVal=mode; colorMaxH=mH; colorMaxS=mS; colorMaxB=mB; colorMaxA=mA; }