fill( color, alpha=1 )

Fill takes a 'color', and then fill the entire screen using it. See the joined article on Using Colors for an explanation of the colour values this function can take.

It can optionally take an 'alpha' value, for deciding the transparency to use when filling, and this defaults to 1.0.

Note that fill ignores transformations, and will always fill the whole screen.

// fills the screen with black
fill( :black )

// fills the screen with only half black
fill( :black, 0.5 )

fill( red, green, blue, alpha=1 )

This version allows you to specify the individual red, green and blue components to use.

// fills the screen with white
fill( 255, 255, 255 )

// apply a slight red tint
fill( 255, 0, 0, 0.3 )

See also

Using Colors