Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. import turtle
  2.  
  3. draw = turtle.Turtle()
  4.  
  5. # background color & stuff...
  6. wn=turtle.Screen()
  7. wn.bgcolor("gray")
  8.  
  9. colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'purple']
  10.  
  11. draw.speed(10) # Only because speed 0 showed no animation and is still slow :/
  12. # Hiding the turtle (showing it is cool too)
  13. #draw.hideturtle()
  14.  
  15. # Ying Yang function, its all softcoded into a whole area and a perfect circle which is why its a long function.
  16. def yingYang(color, color2, radius):
  17. draw.color("black")
  18. draw.fillcolor(color)
  19. draw.begin_fill()
  20. draw.circle(-radius/2, 180)
  21. draw.circle(radius/2, 180)
  22. draw.circle(radius, 180)
  23. draw.end_fill()
  24. draw.left(0)
  25. draw.circle(radius, 180)
  26. draw.left(90)
  27. draw.penup()
  28. draw.color("black")
  29. draw.fillcolor(color2)
  30. draw.forward(radius/3)
  31. draw.right(90)
  32. draw.pendown()
  33. draw.begin_fill()
  34. draw.circle(radius/8, 360)
  35. draw.end_fill()
  36. draw.penup()
  37. draw.left(90)
  38. draw.backward(radius/3)
  39. draw.left(90)
  40. draw.pendown()
  41. draw.color("black")
  42. draw.circle(-radius)
  43.  
  44. # Regular Yin(g) Yang effect and its all softcoded.
  45.  
  46. while True:
  47. yingYang("white", "black", 100)
  48. yingYang("black", "white", 100)
  49.  
  50. # Colorful effect down there
  51.  
  52. #y = 0
  53. #while True:
  54. # if (y == len(colors)):
  55. # y = 0
  56. # yingYang(colors[y], "black", 100)
  57. # yingYang(colors[0] if y == (len(colors)) - 1 else colors[y + 1] , "white", 100)
  58. # y = y + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement