Color_Commands

Logo Color Commands


In Logo, the pen color can be modified with the **SETPC** command followed by a single integer, a text command, or an RBG sequence. The background color can be changed using the **SETBG** command and the interior of a shape can be changed using the **FILL** command. Recall that the pen width can be changed using the **SETW** command with an integer value between 1 and 99. *Use the color picker (in the toolbox) to find the RGB (red green blue) values.
 * ** Command ** || ** Result ** ||
 * SETPC 4 || This will change the pen color to red. ||
 * SETPC “YELLOW || This will change the pen color to yellow. Note there is a space after the setpc command and you must type the double quote symbol. ||
 * SETPC [0 255 0] || This will set the pen color to lime green using the RGB values. The three integers indicate the amount of red, green and blue to be mixed. ||

Basic Color Chart: *There are additional colors that are not listed above.
 * 0 || Black ||  || 8 || DarkGray ||
 * 1 || Blue ||  || 9 || LightBlue ||
 * 2 || Green ||  || 10 || LightGreen ||
 * 3 || Cyan ||  || 11 || LightCyan ||
 * 4 || Red ||  || 12 || LightRed ||
 * 5 || Violet ||  || 13 || Magenta ||
 * 6 || Brown ||  || 14 || Yellow ||
 * 7 || LightGray ||  || 15 || White ||

Change the background color to brown by typing SETBG 6

To color the interior of a shape, you must do the following: 1. Move the turtle __to a location inside__ the shape (I suggest a pen up, move, pen down sequence). 2. Change to the desired color. 3. Type FILL. (You will not see the turtle because it is the same color as the square, so use pen up (PU) and carefully move him out of the square.)

Practice the color commands by typing the following sequences in the listener window. repeat 4[fd 100 rt 90] pu rt 45 fd 10 setpc "red pd fill  setbg "green pu || cs pd setbg 1 setpc 0 setw 10 repeat 6[rt 60 fd 100] pu setxy [15 0] setpc [25 100 150] pd fill ||
 * cs

Refer to the help menu for additional examples and information.