Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # gradient_color_arc.py
- import tkinter as tk
- root = tk.Tk()
- width,height=400,220
- d=str(width)+"x"+str(height)
- root.geometry(d)
- canvas = tk.Canvas(root,width=width,height=height)
- canvas.pack()
- x1,y1,x2,y2=25,30,370,370
- arc_w=40
- def my_upd(d):
- change=int((255/180)*d) # increment in colour value
- color_c='#%02x%02x%02x' % (255-change, change,0)
- return color_c
- res=1 # resolution or steps
- for d in range(0,180,res):
- canvas.create_arc(x1, y1,x2,y2, start=d, extent=res+1,outline=my_upd(d),
- width=arc_w,style=tk.ARC)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement