本文整理汇总了Python中tkinter.colorchooser.askcolor函数的典型用法代码示例。如果您正苦于以下问题:Python askcolor函数的具体用法?Python askcolor怎么用?Python askcolor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了askcolor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _select_color
def _select_color( self):
if self.color:
color = tkColorChooser.askcolor( self.color)
else:
color = tkColorChooser.askcolor()
if color[1]:
self.set_color( color[1])
self.rgb = color[0]
self.configure( background=self.color, activebackground=self.color,
activeforeground=self.foreground_color, foreground=self.foreground_color)
示例2: onCmdChooseColor
def onCmdChooseColor(self,extra):
self.logger.debug('extra=%s',extra)
if extra=='bg':
_,r=tkColorChooser.askcolor(self.c.bg,title='Choose background color')
if r:
self.c.bg=r
self.text.configure(bg=self.c.bg)
elif extra=='fg':
_,r=tkColorChooser.askcolor(self.c.fg,title='Choose foreground color')
if r:
self.c.fg=r
self.text.configure(fg=self.c.fg)
示例3: changeColor
def changeColor(*args):
global foreIndex
tag = "color" + str(foreIndex)
foreIndex += 1
textArea.tag_add(tag,tkinter.SEL_FIRST,tkinter.SEL_LAST)
newColor = colorchooser.askcolor(color="White",title="Color Chooser")
textArea.tag_config(tag,foreground=newColor[1])
示例4: _selectForeColor
def _selectForeColor(self):
(tripleColor, tkColor) = colorchooser.askcolor(self._foreColor)
if tripleColor is None:
return
self._backSelector.configure(foreground=tkColor)
self._foreSelector.configure(foreground=tkColor)
self._foreColor = (int(tripleColor[0]), int(tripleColor[1]), int(tripleColor[2]))
示例5: PromptColor
def PromptColor():
chosenColor = colorchooser.askcolor(initialcolor='#00ff00',
title="Pick a color")
RED, GREEN, BLUE = [abs(int(x)) for x in chosenColor[0]]
app.red_value.set(RED)
app.green_value.set(GREEN)
app.blue_value.set(BLUE)
示例6: chooseColour
def chooseColour(self, number):
newColour = colorchooser.askcolor()[-1]
self.canvasApp.changeColourDict(number, newColour)
self.colourChooserDialog.focus_set()
for child in self.dialogFrame.winfo_children():
if child.cget("text") == "Choose Colour {}".format(str(number)):
child.config(bg=newColour)
示例7: askcolor
def askcolor():
tempwindow = tk.Tk()
tempwindow.state("withdrawn")
rgb,hexcolor = tkColorChooser.askcolor(parent=tempwindow, title="choose color for "+text) ;
tempwindow.destroy()
print("you picked the following color for "+str(text)+": "+str(hexcolor))
return hexcolor
示例8: colorchooser_func
def colorchooser_func():
# Choisir une couleur depuis un pop up sympa
# Annuler: return (None, None)
color = colorchooser.askcolor(color = "red")
return color
示例9: getCustom
def getCustom(self):
"""Request a custom RGB color using a colorchooser"""
result = colorchooser.askcolor(
initialcolor=RGB255hex(RGBreal255(self.color)), title="Custom Color", parent=self
)
if result != (None, None):
self.setColor((result[0][0] / 255.0, result[0][1] / 255.0, result[0][2] / 255.0))
示例10: color_background
def color_background(self):
color = colorchooser.askcolor(parent=self.master)
if color!=None:
TextView.text.config(background=color[1])
else:
pass
示例11: checkAutre
def checkAutre(self,widget):
new_col = askcolor()[1]
if new_col != None:
self.colors.append(new_col)
widget['menu'].add_command(label=new_col,command=self.__colorVar.set(new_col))
self.__colorVar.set(new_col)
self.createColorIcon(widget)
示例12: bg_color_selection
def bg_color_selection():
choosen_color = colorchooser.askcolor()
if choosen_color[1]:
settings["background_color"] = choosen_color[1]
bg_color.configure(background=settings["background_color"])
settings_wnd.focus_force()
示例13: print
def värv():
color = colorchooser.askcolor()
color_name = color[1]
raam.configure(background=color_name)
global colour
colour = color_name
print(colour)
示例14: color_callback
def color_callback(self, source):
# Prompt a color picker, set the options and the background/foreground of the button
nums, hex_color = askcolor(color=getattr(self.options, source), title="Color Chooser")
if hex_color:
opposite = self.opposite_color(hex_color)
setattr(self.options, source, hex_color.upper())
self.buttons[source].configure(bg=hex_color, fg=opposite)
示例15: changeBackColor
def changeBackColor(*args):
global backIndex
tag = "back" + str(backIndex)
backIndex += 1
textArea.tag_add(tag,tkinter.SEL_FIRST,tkinter.SEL_LAST)
newColor = colorchooser.askcolor(color="White",title="Color Chooser")
textArea.tag_config(tag,background=newColor[1])