You can select up to 140 colours with Lynx. To change the turtle's colour when it's in the original shape, use setcolour
command (short form is setc
).
setcolour (setc)
setcolour number_or_colour_name
setc number_or_colour_name
This command sets the colour of the turtle's pen. If the turtle has its original shape, it changes colour to show the pen colour. The input can be the name of a colour or a number. The original pen colour is black, or colour number 9. The input can be an integer, a fraction or a one place decimal. Often used with setpensize
, pd
(pen down), fill
, forward
and back
. See also colour
in the comprehensive Help.
Valid colour names are: black, gray, white, red, orange, brown, yellow, green, lime, sky, cyan, blue, magenta, turquoise, violet, pink
There are 140 colours. You can use a larger number, but the colour map will wrap.
The brightest colours end with 5 (colour 15, 25, 35, 45, etc).
Here is Lynx colour chart:
Examples
(given that you have a turtle on the page)
setcolour 15
setcolour 'blue'
repeat 10 [setc colour + 1 wait 5]