博客
关于我
tkinter: 颜色选取对话框. 2021-01-16
阅读量:264 次
发布时间:2019-03-01

本文共 668 字,大约阅读时间需要 2 分钟。

import tkinter.messageboximport tkinter.colorchooserwin = tkinter.Tk()win.title('tkinter:颜色选取对话框')win.geometry('320x480')color_dialog = tkinter.colorchooser.Chooser(win)def colordialog():    color = color_dialog.show()    # color对象得到的赋值是一个元组,格式:((R, G, B), "#rrggbb")    # 例:当选择红色确认后返回值为(255.99609375, 0.0, 0.0), '#ff0000')    tkinter.messagebox.showinfo(title='提示',                                message=                                '''所选颜色1. 十六进制颜色码是: %s2. RGB数值为: %s                                '''                                % (color[1], color[0]))tkinter.Button(win,               text='打开选色对话框',               command=colordialog).pack()win.mainloop()

 

转载地址:http://jsla.baihongyu.com/

你可能感兴趣的文章
Nginx 学习总结(17)—— 8 个免费开源 Nginx 管理系统,轻松管理 Nginx 站点配置
查看>>
Nginx 学习(一):Nginx 下载和启动
查看>>
nginx 常用指令配置总结
查看>>
Nginx 常用配置清单
查看>>
nginx 常用配置记录
查看>>
nginx 开启ssl模块 [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx
查看>>
Nginx 我们必须知道的那些事
查看>>
Nginx 的 proxy_pass 使用简介
查看>>
Nginx 的配置文件中的 keepalive 介绍
查看>>
Nginx 结合 consul 实现动态负载均衡
查看>>
Nginx 负载均衡与权重配置解析
查看>>
Nginx 负载均衡详解
查看>>
nginx 配置 单页面应用的解决方案
查看>>
nginx 配置https(一)—— 自签名证书
查看>>
nginx 配置~~~本身就是一个静态资源的服务器
查看>>
Nginx 配置清单(一篇够用)
查看>>
Nginx 配置解析:从基础到高级应用指南
查看>>
nginx+php的搭建
查看>>
nginx+tomcat+memcached
查看>>
nginx+Tomcat性能监控
查看>>