fill()ColorSettingWeb & Applicationfill_.gif
fill(153);
rect(30, 20, 55, 55);
fill_2.gif
fill(204, 102, 0);
rect(30, 20, 55, 55);
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.
fill(gray)
fill(gray, alpha)
fill(value1, value2, value3)
fill(color)
fill(color, alpha)
fill(value1, value2, value3, alpha)
int or float: number specifying value between white and blackint or float: red or hue valueint or float: green or saturation valueint or float: blue or brightness valueint or float: opacity of the fillcolor: any value of the color datatypeNone
noFill()
colorMode()
1.0FunctionCore