Free Online Turtle Graphics : logointerpreter.com - Surf your logo code!
Turtle Graphics - Pen and Background Control

[Index] [<< Previous section: Turtle and Window Control] [Next section: Stroking and Filling Paths >>]

pendown
pd
Description: sets the pen down and the turtle resumes leaving a trail as it moves on the canvas.
penup
pu
Description: sets the pen up and the turtle stops leaving a trail as it moves on the canvas.
penpaint
Description: (default) sets the drawing mode to PAINT.
penerase
Description: sets the drawing mode to ERASE.
Example:
penerase
setpensize 30
fd 100
The result is shown bellow:
setpencolor color
setpc color
setcolor color
Description: sets the stroke color (default: black). The color can be set using standard color codes or html HEX values:
Examples:
setcolor "red
setcolor "4
setcolor "#ff0000
Standard color codes: 0: "black" (
), 1: "blue" (
), 2: "lime" (
), 3: "cyan" (
), 4: "red" (
), 5: "magenta" (
),
6: "yellow" (
), 7: "white" (
), 8: "brown" (
), 9: "tan" (
), 10: "green" (
), 11: "aquamarine" (
), 12: "salmon" (
),
13: "purple" (
), 14: "orange" (
), 15: "gray" (
).
setpensize value
setwidth value
setpw value
Description: sets the pen size to a number of value pixels.
setbgcolor color
Description: sets the background color of the canvas (note: draws a 500x500px square on the graphics canvas). The color can be set using standard color codes or html HEX values:
Example:
setbgcolor "green
setbgcolor "10
setbgcolor "#00ff00
The result is shown bellow:
Standard color codes: 0: "black" (
), 1: "blue" (
), 2: "lime" (
), 3: "cyan" (
), 4: "red" (
), 5: "magenta" (
),
6: "yellow" (
), 7: "white" (
), 8: "brown" (
), 9: "tan" (
), 10: "green" (
), 11: "aquamarine" (
), 12: "salmon" (
),
13: "purple" (
), 14: "orange" (
), 15: "gray" (
).
setbgimg image
Description: sets a background image using the image name.
Some of the names are: "White", "Beach", "Field", "Winter", "Space", "Scene", etc. You can find all the available images using the Background image panel from the editor:
Example:
setbgimg "Winter
The result is shown bellow:

[Index] [<< Previous section: Turtle and Window Control] [Next section: Stroking and Filling Paths >>]
  1. Turtle Graphics section's content: Go to top
Get the new 2023 ebook!
(Surf Your Logo Code! - author: Vlad TUDOR)
Online Turtle Graphics - a free and modern web-based logo interpreter
Create an account now! It's EASY and FREE. Learn Logo & Turtle Graphics!
Find us on facebook
Get social with us!
World Map
Check other turtles
around the world!
Need help?
Browse our
support topics
Logo reference
Learn about your
turtle's language