 |
 |
 |
 |
Name |
|
fill() |
 |
|
|
Examples |
|
 |
fill(153);
rect(30, 20, 55, 55);
|
 |
 |
fill(204, 102, 0);
rect(30, 20, 55, 55);
|
 |
|
Description |
|
Sets the color used to fill shapes. For example, if you call fill(204, 102, 0) and draw a rectangle it will be filled with orange. This color is either specified in terms of the RGB or HSB color depending on the current colorMode(). The default color space is RGB, with each value in the range from 0 to 255. The version of fill() with one parameter specifies a gray value, the version with three parameters specifies a color, and the version with four parameters specifies a color with an alpha value. Note: the value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default value is 255. |
 |
|
|
Syntax |
|
fill(gray)
fill(gray, alpha)
fill(value1, value2, value3)
fill(color)
fill(color, alpha)
fill(value1, value2, value3, alpha)
|
 |
|
|
Parameters |
|
gray |
|
int or float: number specifying value between white and black
|
value1 |
|
int or float: red or hue value
|
value2 |
|
int or float: green or saturation value
|
value3 |
|
int or float: blue or brightness value
|
alpha |
|
int or float: opacity of the fill
|
color |
|
color: any value of the color datatype
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
noFill() colorMode() |
|