If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

background(r, g, b, a*)

Sets the background color of the canvas. Note that calling this will color over anything drawn before the command.
Parameters:
NameDescription
ramount of red, ranges from 0 to 255
gamount of green, ranges from 0 to 255
bamount of blue, ranges from 0 to 255
a(Optional) transparency, ranges from 0 to 255

Want to join the conversation?

No posts yet.