Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- draw = turtle.Turtle()
- # background color & stuff...
- wn=turtle.Screen()
- wn.bgcolor("gray")
- colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'purple']
- draw.speed(10) # Only because speed 0 showed no animation and is still slow :/
- # Hiding the turtle (showing it is cool too)
- #draw.hideturtle()
- # Ying Yang function, its all softcoded into a whole area and a perfect circle which is why its a long function.
- def yingYang(color, color2, radius):
- draw.color("black")
- draw.fillcolor(color)
- draw.begin_fill()
- draw.circle(-radius/2, 180)
- draw.circle(radius/2, 180)
- draw.circle(radius, 180)
- draw.end_fill()
- draw.left(0)
- draw.circle(radius, 180)
- draw.left(90)
- draw.penup()
- draw.color("black")
- draw.fillcolor(color2)
- draw.forward(radius/3)
- draw.right(90)
- draw.pendown()
- draw.begin_fill()
- draw.circle(radius/8, 360)
- draw.end_fill()
- draw.penup()
- draw.left(90)
- draw.backward(radius/3)
- draw.left(90)
- draw.pendown()
- draw.color("black")
- draw.circle(-radius)
- # Regular Yin(g) Yang effect and its all softcoded.
- while True:
- yingYang("white", "black", 100)
- yingYang("black", "white", 100)
- # Colorful effect down there
- #y = 0
- #while True:
- # if (y == len(colors)):
- # y = 0
- # yingYang(colors[y], "black", 100)
- # yingYang(colors[0] if y == (len(colors)) - 1 else colors[y + 1] , "white", 100)
- # y = y + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement