Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # tk_radial_gradient.py
- from tkinter import *
- import time
- ww = 600
- hh = 600
- root = Tk()
- root.title('tk_radial_gradient')
- root.geometry(f'{ww}x{hh}+0+0')
- canvas = Canvas(root, width=ww, height=hh, bg='black')
- canvas.pack()
- x = ww//2
- y = hh//2
- gradient = 0
- radius = 255 + 1
- while gradient < 256:
- color = f"#00{gradient:02x}00"
- canvas.create_oval(x - radius, y - radius, x + radius, y + radius, fill=color, outline="")
- gradient += 1
- radius -= 1
- canvas.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement