Colors (or Colours)

You can set colors in guizero using:

Colors can be used as either starting parameters e.g. :

app = App(bg = "red")
app = App(bg = "#ff0000")
app = App(bg = (255, 0, 0))

or as properties e.g. :

text = Text(app, text = "hi")
text.text_color = "green"
text.text_color = "#00ff00"
text.text_color = (0, 255, 0)

If a color is set using a list of rgb values ((255,255,255)) it will be returned as an #rgb hex value (#ffffff)

Color names

Color names can be given as strings e.g.

A complete list of color names is available at wiki.tcl.tk/37701

rgb hex value

A rgb color value must start with a # and 6 characters following, 2 each for the red, green and blue value in hex. Each value must be 00 - ff e.g.

You can mix your own color by changing the red, green and blue values.

There is a RGB calculator application at https://www.w3schools.com/colors/colors_rgb.asp where you can create your own color and get the #rrggbb value.

rgb list

The (red, green, blue) list color, must have 3 elements in the order red, green, blue with values 0 - 255 e.g.