I am using python under the turtle module. In this code I am drawing multiple squares at a certain point of the window. However, I would like to change the colors of the lines that is dependent on the value I want to give. For example, from value 0-10 I want it to be blue, and from 11-20 I want it to be red. I am not familiar with turtle. Henceforth, I am not too sure how it works. Is there another module or extension I could use in python to help draw out colored lines that are based on values?
Screen = turtle.Screen()
Screen.bgcolor('White')
Screen.setup(width= 1200, height= 700, startx= 200, starty =0)
#First Square
turtle.colormode(255)
my_pen = turtle.Turtle()
my_pen.color(randint(0,255),randint(0,255),randint(0,255))
my_pen.up()
my_pen.setpos(-599,341)
my_pen.down()
my_pen.speed(10)
my_pen.width(4)
def form_sq(side):
for i in range(4):
my_pen.fd(side)
my_pen.right(90)
side -= 5
side = 200
for i in range(10):
form_sq(side)
side-= 20