Reference for Processing version 1.2. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.
Name | color() |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Examples | color c1 = color(102, 102, 0); fill(c1); noStroke(); rect(30, 20, 55, 55); |
||||||||||||
Description | Creates colors for storing in variables of the color datatype. The parameters are interpreted as RGB or HSB values depending on the current colorMode(). The default mode is RGB values from 0 to 255 and therefore, the function call color(255, 204, 0) will return a bright yellow color. More about how colors are stored can be found in the reference for the color datatype. | ||||||||||||
Syntax | color(gray) color(gray, alpha) color(value1, value2, value3) color(value1, value2, value3, alpha) color(hex) color(hex, alpha) |
||||||||||||
Parameters |
|
||||||||||||
Returns | color | ||||||||||||
Usage | Web & Application | ||||||||||||
Related | color_datatype colorMode() |