博客
关于我
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/

你可能感兴趣的文章
Netty源码—3.Reactor线程模型三
查看>>
Netty源码—4.客户端接入流程一
查看>>
Netty源码—4.客户端接入流程二
查看>>
Netty源码—5.Pipeline和Handler一
查看>>
Netty源码—5.Pipeline和Handler二
查看>>
Netty源码—6.ByteBuf原理一
查看>>
Netty源码—6.ByteBuf原理二
查看>>
Netty源码—7.ByteBuf原理三
查看>>
Netty源码—7.ByteBuf原理四
查看>>
Netty源码—8.编解码原理一
查看>>
Netty源码—8.编解码原理二
查看>>
Netty源码解读
查看>>
Netty的Socket编程详解-搭建服务端与客户端并进行数据传输
查看>>
Netty相关
查看>>
Netty简介
查看>>
Netty速成:基础+入门+中级+高级+源码架构+行业应用
查看>>
Netty遇到TCP发送缓冲区满了 写半包操作该如何处理
查看>>
Netty:ChannelPipeline和ChannelHandler为什么会鬼混在一起?
查看>>
Netty:原理架构解析
查看>>
Network Dissection:Quantifying Interpretability of Deep Visual Representations(深层视觉表征的量化解释)
查看>>