from Tkinter import * import colorsys #操作后的响应函数 def update(* args): 'color' r,g,b = colorsys.hls_to_rgb(h.get() / 255.0, l.get() / 255.0, s.get() / 255.0) r,g,b = r * 255, g * 255, b * 255 rgb.configure(text = 'RGB:(%d, %d, %d)' % (r, g, b)) c.configure(bg = '#XXX' %(r, g, b)) root = Tk() hue = Label(root, text = 'Hue') hue.grid(row = 0, column = 0) light = Label(root, text = 'Lightness') light.grid(row = 0, column = 1) sat = Label(root, text = 'Saturation') sat.grid(row = 0, column = 2) #初始化颜色为rgb的000,也就是纯黑色 rgb = Label(root, text = 'RGB(0, 0, 0)') rgb.grid(row = 0, column = 3) h = Scale(root, from_ = 255, to = 0, command = update) h.grid(row = 1, column = 0) l = Scale(root, from_ = 255, to = 0, command = update) l.grid(row = 1, column = 1) s = Scale(root, from_ = 255, to = 0, command = update) s.grid(row = 1, column = 2) c = Canvas(root, width = 100, height = 100, bg = 'Black') c.grid(row = 1, column = 3) root.mainloop()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有