background()

Color / Setting

Description

Sets the color used for the background of the Processing window. Called in draw() to clear the canvas each frame.

Syntax

void background(float gray) void background(float gray, float a) void background(float r, float g, float b) void background(float r, float g, float b, float a) void background(color c) void background(const PImage& img)

Parameters

NameTypeDescription
grayfloatgrayscale value (0-255)
rfloatred component
gfloatgreen component
bfloatblue component
afloatalpha (optional)
imgPImageimage to use as background

Returns

void

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...