Using colour

Colours are created using a 3 number variable, COLORNAME = (red, green, blue), where each colour value is between 0 and 255.

BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED   = (227, 27, 27)
GREEN = (0, 255, 0)
BLUE  = (0, 0, 255)

Colours can also be written using hexadecimal numbers. This is handy as frequently colour charts will give you a colour in that form.

For instance, the colour PINK might be #ff99cc. To use that as a Python colour variable, you would write it as:

PINK = (0xFF, 0x99, 0xCC)

To get a colour at a given pixel

pixel_colour = window.get_at(( x , y ))

A good online resource for picking colours is https://htmlcolorcodes.com