简体   繁体   English

Tkinter-colorchooser中的默认颜色

[英]Tkinter - default colour in colorchooser

In the colorchooser dialog I would like to set a default colour in the chooser that it sets the colour to first, instead of the grey colour. 在colorchooser对话框中,我想在选择器中设置默认颜色,该颜色将颜色设置为第一,而不是灰色。

self.colour = colorchooser.askcolor()[1]

The current way it is set out is: 当前列出的方式是:

在此处输入图片说明

But it would be good if the default in the bottom right was a different colour. 但是,如果右下角的默认颜色是其他颜色,那会很好。 I would appreciate any help :) 我将不胜感激任何帮助 :)

Here's one way: 这是一种方法:

colorchooser.askcolor('#ffd9d9')

or simpler 或更简单

colorchooser.askcolor('red')

or even 甚至

colorchooser.askcolor((10,20,30))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM