File: select_color.py

package info (click to toggle)
python-guizero 1.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,828 kB
  • sloc: python: 6,744; makefile: 28; sh: 17
file content (19 lines) | stat: -rw-r--r-- 423 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from guizero import App, PushButton, Text


def get_color():
    color_selected = app.select_color("#000000")
    # color_selected = app.select_color()
    if color_selected is not None:
        color_name.value = "Color: " + color_selected
    else:
        color_name.value = ""


app = App()

PushButton(app, command=get_color, text="Get color")
color_name = Text(app)
color_name.value = "Color: #rrggbb"

app.display()