An Introduction to Color in Python Turtle
Additive and subtractive color mixing

source Athabasca University / CC BY-SA
In this story we demonstrate how python turtle mixes color through additive color mixing.
The classical or conventional primary colors are red, green, and blue. The true primary colors are Cyan, Magenta, and yellow. Through most of our recent history, artists have only had access to a few kinds of pigments. They did the best with what they had to work with.
When you limit your primary palette to red, yellow, and blue It gives your painting a more classic, less natural look
Today artists can create paintings with brighter more natural color and modern printing and lithography produce brighter more realistic colors by mixing cyan magenta and yellow.
Yellow and cyan produce green. Cyan and magenta produce purple and magenta and yellow produce orange.
Black could be created with large amounts of these colors. However it is cost effective and produces a better result with separate black ink.
All color printers have cyan, yellow, magenta, and black ink.
With additive or light reflecting colors Red and green combine to make yellow. Green and blue combine to make cyan. Blue and red combine to make magenta.
Your eyes take in light, and they see three colors Red green and blue. Every color you see is some combination of red green and blue.
An object that is painted red, absorbs green and blue light, and it reflects red light back into your eyes. If it’s painted yellow, that means it absorbs blue light and it reflects red and green light back into your eye which you perceive as yellow.
Here is a python turtle program that demonstrates mixing red and green through additive color mixing.
We import turtle and set the colormode.
import turtle as T
T.colormode (255)We move the turtle to left side of the screen in the middle and set the line thickness to 50
T.penup ()
T.goto (-250,0)
T.pendown ()
T.width (50)We start at 255 and go down to 50 counting by 10 with each iteration we add increasingly less red and green to the color and move the turtle forward 20 steps.
It is a bit counter intuitive as the amount of color decreases there is less color reflecting back to your eye and when it gets close to 0 it becomes black.
for i in range (255,50,-10):
T.color (i,i,0)
T.forward (20)We do the same thing with red and blue moving the turtle down the screen.
T.penup ()
T.goto (-250,-250)
T.pendown ()
T.width (50)
for i in range (255,50,-10):
T.color (i,0,i,)
T.forward (20)Finally we move the turtle up the screen and mix red and blue.
T.penup ()
T.goto (-250,250)
T.pendown ()
T.width (50)
for i in range (255,50,-10):
T.color (0,i,i,)
T.forward (20)
Jim McAulay🍁 says: My grandfather always used to say “when one door closes another one opens.” He was a nice man but a terrible cabinet maker.
49–49
17–17






