title: Triangular/geometric rainbow spiral
body: <p>I've been trying to find out how to make a rainbow triangular spiral using Python.  I can make a square spiral but it won't import the color. Also it's not using triangles.</p>
  
  <p>What the output is supposed to look like:</p>
  
  <p><a href="https://i.stack.imgur.com/UmA24.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UmA24.png" alt="enter image description here"></a></p>
  
  <p>What I achieved:</p>
  
  <p><a href="https://i.stack.imgur.com/MG5a0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MG5a0.png" alt="enter image description here"></a></p>
  
  <p>My code:</p>
  
  <pre><code>    import turtle 
      import colorsys
  
      p = turtle.Pen()
      p.reset()
      p.down()
      p.speed(22)
  
  
      for i in range(100):
          p.forward(i)
          p.left(22222)
  
      dog = 0
  
      for i in range(100):
          color = colorsys.hsv_to_rgb(dog,1,1)
          turtle.pencolor(color)
          dog += 0.01
  </code></pre>