Lesson goal: Change the colors of your plots

Previous: Drawing pixels | Home | Next: Clearing the screen

You can change the plotting color of your graphics using the color function. color works like this:
color(n)
Move the mouse over a dotted box for more information.

0=black
1=Green
2=Yellow
3=Blue
4=Red
5=Buff
6=Cyan
7=Magenta
8=Orange
9=White

Now you try. Plot some pixels using pset, but just before the pset line, choose a color for yourself using the color function.

Type your code here:


See your results here:

Show a friend, family member, or teacher what you've done!

Here is a share link to your code:

Does your code work? Want to run it on your iPhone?

Here's your code:

  1. Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.

  2. Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into this page

  3. Then click the "Use on iPhone" button that you'll see.