 |
 |
 |
 |
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 and all subsequent shapes 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). Note: the value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255. |
 |
|
|
Syntax |
|
fill(gray)
fill(gray, alpha)
fill(color)
fill(value1, value2, value3)
fill(value1, value2, value3, alpha)
|
 |
|
|
Parameters |
|
gray |
|
int or float: number specifying value between white and black
|
alpha |
|
int or float: opacity of the fill
|
color |
|
color: any value of the color datatype
|
value1 |
|
int or float: red or hue value
|
value2 |
|
int or float: green or saturation value
|
value3 |
|
int or float: blue or brightness value
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
noFill() colorMode() |
|
|