• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python colorchooser.askcolor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tkinter.colorchooser.askcolor函数的典型用法代码示例。如果您正苦于以下问题:Python askcolor函数的具体用法?Python askcolor怎么用?Python askcolor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了askcolor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: custermizeSSEColor

    def custermizeSSEColor(self, sse):
        SSE_col_but = {
            'H': self.H_col_but,
            'G': self.G_col_but,
            'I': self.I_col_but,

            'E': self.E_col_but,
            'B': self.B_col_but,

            'T': self.T_col_but,
            'S': self.S_col_but,
            '-': self.N_col_but,

            'b': self.b_col_but,
            'C': self.C_col_but,
        }
        try:
            color_tuple, color = tkColorChooser.askcolor(color=self.SSE_col[sse])
            if color_tuple is not None and color is not None:
                self.SSE_col_RGB[sse] = color_tuple
                self.SSE_col[sse] = color

                SSE_col_but[sse]['bg'] = self.SSE_col[sse]
                SSE_col_but[sse]['activebackground'] = self.SSE_col[sse]
                SSE_col_but[sse].update()
        except Tkinter._tkinter.TclError:
            print('Old color (%s) will be used.' % (self.mesh_col))
开发者ID:Pymol-Scripts,项目名称:Pymol-script-repo,代码行数:27,代码来源:dssp_stride.py


示例17: popupColorPicker

 def popupColorPicker():
     # Can pass in current color with: color = (255, 0, 0)
     color = askcolor(
         parent = vgp.interior(),
         # Initialize it to current color
         initialcolor = tuple(vgp.get()[:3]))[0]
     if color:
         vgp.set((color[0], color[1], color[2], vgp.getAt(3)))
开发者ID:Moteesh,项目名称:panda3d,代码行数:8,代码来源:Valuator.py


示例18: color_resaltado

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


示例19: changeColourOfTextBackground

def changeColourOfTextBackground():
    try:
        colour= colorchooser.askcolor()[1]
    except:
        askError("Error", "Error Launching Colour Picker")
    else:
        if colour != None:
            textWindow.config(bg=colour)
开发者ID:angusgoody,项目名称:Python-Text-Editor,代码行数:8,代码来源:text+editor+1.0.py


示例20: color_Arbre

def color_Arbre(fr):
    tmp = fr.color
    fr.color = colorchooser.askcolor()
    if fr.color[0]:
        fr.color = list(fr.color[0])
        fr.MAJ_Canvas()
    else:
        fr.color = tmp
开发者ID:T-800,项目名称:LS4,代码行数:8,代码来源:Popup.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python filedialog.askdirectory函数代码示例发布时间:2022-05-27
下一篇:
Python tkinter.Toplevel类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap