python|tkinter implements color selector

tags: python try  tkinter  python

This blog post is based on python, mainly discusses how to use colorchooser to complete the color selector

Experimental effect

Experimental principle

Create a color picker function, bind it with the button, and load it into the main window

Experimental effect

# -*- coding:utf-8 -*-
#
import tkinter
import tkinter.colorchooser


def ChooseColor():
    r = tkinter.colorchooser.askcolor(title='Color picker')
    print(r)


root = tkinter.Tk()
button1 = tkinter.Button(root, text='Choose Color',
                         command=ChooseColor)
button1.pack()
root.mainloop()

Intelligent Recommendation

Python implements color detection, contour detection, color tracking

Python-OpenCV learning Ready to work Read images and videos basic functions Cropped image Draw graphics and text Perspective conversion Image splicing Color detection Contour detection Color tracking ...

Python implements pat 1054. The Dominant Color (20)

1054. The Dominant Color (20) topic Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the...

Python simply implements the two-color ball function

Python simply implements the two-color ball function 1. Procedure description Two, code implementation Three, running results 1. Procedure description The program also realizes that after selecting a ...

Python implements changing the background color of the ID photo

python passopencv-pythonCombinenumpyachieveChange the background color of the ID photo Library installation:pip install opencv-python -i http://pypi.douban.com/simple --trusted-host pypi.douban.com pi...

Python implements two-color ball random generator

New Python file Double-color-balls-random.py Run code effect...

More Recommendation

Python implements the border of the pure color image.

First above the renderings, here is a bit color difference, the actual value is solid, not mixed. The largest partial details are like this The original picture is the following The biggest feature of...

Python + OpenCV implements text color identification and calibration

I recently received a relatively simple image processing list, spent a little time to write: Data set customers are not created casually: The procedure is as follows: First give the upper and lower th...

Python Numpy implements the image-by-pixel pixel by color

Article catalog Method I use Numpy Broadcasting Mechanism Method 2 By comparing RGB one-dimensional array contrast to scalar Method three to accelerate comparison through the Hash plus matrix operatio...

Python implements PS color order algorithm

Recently, a script for analyzing pictures, using OpenCV's automatic grade, feel very difficult, the result of different images can be made, then discovered that the PS manually adjust the color step o...

OpenCV + Python implements color separation in GIF images

If you have any understanding,Click for attention, private letter, I will happen ~~, Seeing timely reply At the time of the HSV color space, then read the form, the GIF picture I will put it below, an...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top