Advertisement
here2share

# tk_green_blast.py

May 3rd, 2023
908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. # tk_green_blast.py
  2.  
  3. # Imports
  4. from tkinter import *
  5. import time
  6.  
  7. ww = 600
  8. hh = 600
  9.  
  10. root = Tk()
  11. root.title('green blast')
  12. root.geometry(f'{ww}x{hh}+0+0')
  13.  
  14. canvas = Canvas(root, width=ww, height=hh, bg='black')
  15. canvas.pack()
  16.  
  17. x = ww//2
  18. y = hh//2
  19. while 1:
  20.     radius = 1.5
  21.     gradient = 255
  22.     while gradient > 0:
  23.         t = time.time() + 0.009
  24.         canvas.delete('all')
  25.         color = f"#00{gradient:02x}00"
  26.         canvas.create_oval(x - radius, y - radius, x + radius, y + radius, fill=color, outline="")
  27.         gradient -= 1
  28.         radius -= 1
  29.         while t > time.time():
  30.             canvas.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement