Loading...

RGB Multi Color Heart Shape Petals | Love | #funwithcode #python #coding #pythonprogramming #design

496 15________

RGB Multi Color Heart Shape Petals | Love | #funwithcode #python #coding #pythonprogramming #design #viralvideo #tranding #pythonturtlegraphics
Source Code:
import turtle as tur
import colorsys as csys

tur.setup(1200, 720)
tur.speed(0)
tur.bgcolor('black')
tur.title("Flower with Heart-shaped Petals")
tur.setpos(-20, 100)
tur.width(2)

def rel_pos(x,y):
tur.up()
tur.goto(tur.pos()+(x,y))
tur.down()

def draw_heart(size):
tur.begin_fill()
tur.left(50)
tur.forward(size)
tur.circle(size * 0.5,200)
tur.right(140)
tur.circle(size * 0.5, 200)
tur.forward(size)
tur.left(50)
tur.end_fill()

def drawCircle():
rel_pos(0, 14)
for i in range(0,14):
color = csys.hsv_to_rgb(i/15, 0.5, 1)
tur.fillcolor(color)
tur.begin_fill()
tur.circle(-(140-(i*10)))
rel_pos(-0.5, -10)
tur.end_fill()

def draw_flower(num_petals, size):
tur.color('white')
for i in range(num_petals):
hue = i/num_petals
angle = tur.heading()
for j in range(1,10):
color = csys.hsv_to_rgb(hue, 1-(j/9), 1)
tur.fillcolor(color)
draw_heart(size - (j*10))
tur.left(30)
tur.circle(-(40-(j*4)), 60)
tur.left(26+(j*1.5))
tur.seth(angle)
tur.circle(-130, 45)
drawCircle()
draw_flower(8, 100)
tur.hideturtle()
tur.done()
"Learn Python Graphics in just minutes! This video covers the basics of creating stunning visual designs using Python. Whether you're a beginner or looking to enhance your coding skills, we'll guide you through simple steps to draw shapes, add colors, and bring your graphics to life. Perfect for students, hobbyists, and programmers eager to explore Python's powerful graphics libraries like Turtle, Pygame, and Matplotlib. Subscribe for more coding tutorials and tips!"

Under section 107 of the copyright Act 1976, allowance is mad for FAIR USE for purpose such a as criticism, comment, news reporting, teaching, scholarship and research. Fair use is a use permitted by copyright statues that might otherwise be infringing. Non- Profit, educational or personal use tips the balance in favor of FAIR USE.

#FunWithCode

コメント