Color

Print Version of Color

A / B | C / D / E / F | G / H / I / J / K | L / M / N | O / P / Q | R / S | T / U / V / W / X | T / U / V / W / X / Y / Z

StarLogo has 14 "major" colors, with many shades of each. Different shades are associated with different numbers. For example, the shades of red are associated with the numbers between 10 and 20 (not including 20). Number 10 is a very "dark" red (close to black), number 15 is the "purest" red, and number 19 is a "light" red (close to white). Similarly, number 20 is a dark orange, number 25 is the purest orange, and number 29 is a light orange. (Note: Fractional numbers can also represent different shades, if your computer supports enough colors.)

These numbers are used as inputs to the commands setc (which sets the color of turtles) and setpc (which sets the color of patches). So the command ask-patches[setpc 15] will turn all of the patches red, while ask-patches[setpc 19] will turn the patches a much lighter shade of red. Type ask-patches[setpc xcor + ycor] to see the full range of colors. Color numbers greater than 140 "wrap" (using modulo 140).

The organization of colors by shades is very useful for achieving smooth shading effects using the commands scale-color and scale-pc.

There are commands (e.g., black, red, green) that report color values. These commands report the number for the "purest" shade of the color. For example, red reports 15 and orange reports 25. Color names report numbers in the color listing:

black 0 gray, grey 5
white 9 red 15
orange 25 brown 35
yellow 45 green 55
lime 65 turquoise 75
cyan 85 sky 95
blue 105 violet, purple 115
magenta 125 pink 135

A / B
black

blue

brown

C / D / E / F
color

color-at

color-of

color-towards

count-color

count-color-range

count-pc

count-pc-range

cyan

G / H / I / J / K
gray (grey)

green

grey (gray)

L / M / N
lime

magenta

O / P / Q
orange

patchcolor (pc)

pc (patchcolor)

pc-ahead (pc-ahead-one-step)

pc-ahead-one-step (pc-ahead)

pc-at

pc-towards

pink

ppc

pstamp

pstamp-at

pstamp-towards

purple

R / S
red

scale-color

scale-pc

setbg

setc (setcolor)

setc-at

setc-of

setc-towards

setcolor (setc)

setpatchcolor (setpc)

setpc (setpatchcolor)

setppc

sky

T / U / V / W / X
turquoise

white

T / U / V / W / X / Y / Z
yellow