"EXERCISE 52:RAINBOW TRIANGLES
Color each triangle of the rotating triangle sketch using stroke()
."
It should look like this:
above is the picture my code:
def setup():
colorMode(HSB)
size(600,600)
t = 0
def draw():
global t
background(255)#white
translate (width/2, height/2)
for i in range(90):
stroke(3*i,255,255)
rotate(radians(360/90))
pushMatrix()
translate(200,0)
rotate(radians(t+2*i*360/90))
tri(100)
popMatrix()
t += 0.5
def tri(length):
noFill()
triangle(0, -length, -length*sqrt(3)/2, length/2, length*sqrt(3)/2, length/2)
my code actually creates rainbow triangle, but im not allowed to use colorMode()