当前位置: 首页>>代码示例>>Python>>正文


Python colorchooser.askcolor函数代码示例

本文整理汇总了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)
开发者ID:sctincman,项目名称:bkchem,代码行数:10,代码来源:widgets.py

示例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)
开发者ID:liveonnet,项目名称:mytestzone,代码行数:12,代码来源:panels.py

示例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])
开发者ID:jduffey2,项目名称:Miscellaneous-Python-Projects,代码行数:7,代码来源:TextPad.py

示例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]))
开发者ID:ikozin,项目名称:DashBoard,代码行数:7,代码来源:ModalDialog.py

示例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)
开发者ID:bayang,项目名称:raspberry_snippets,代码行数:7,代码来源:tk_gui_led.py

示例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)
开发者ID:wjm07,项目名称:pixel-canvas,代码行数:7,代码来源:main.py

示例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
开发者ID:karimbahgat,项目名称:Tk2,代码行数:7,代码来源:tkcolor.py

示例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
开发者ID:EnceladOnline,项目名称:interfaX,代码行数:7,代码来源:popup.py

示例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))
开发者ID:vectorgraphics,项目名称:asymptote,代码行数:7,代码来源:xasyColorPicker.py

示例10: color_background

 def color_background(self):
     color = colorchooser.askcolor(parent=self.master)
     
     if color!=None:
         TextView.text.config(background=color[1])
     else:
         pass
开发者ID:jozz68x,项目名称:PyAgenda,代码行数:7,代码来源:textView.py

示例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)
开发者ID:loan181,项目名称:CurvedSnake,代码行数:7,代码来源:combo_couleur_icones2.py

示例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()
开发者ID:joelnir,项目名称:SplitNotes,代码行数:7,代码来源:setting_handler.py

示例13: print

def värv():
    color = colorchooser.askcolor()
    color_name = color[1]
    raam.configure(background=color_name)
    global colour
    colour = color_name
    print(colour)
开发者ID:IlvesPriit,项目名称:Projekt,代码行数:7,代码来源:Projekt.py

示例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)
开发者ID:Zamiell,项目名称:RebirthItemTracker,代码行数:7,代码来源:option_picker.py

示例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])
开发者ID:jduffey2,项目名称:Miscellaneous-Python-Projects,代码行数:7,代码来源:TextPad.py


注:本文中的tkinter.colorchooser.askcolor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。