Colour picker

Pick a colour and copy it as HEX, RGB, HSL, a Pygame (r, g, b) tuple or a pygame.Color call. Build and export a palette for your game.

Updated

Shades

Saved palette

Values

Contrast

Type a value in any field (for example 255, 140, 0) or use the sliders.
On this page

How to use it#

  • Pick a colour with the colour box, drag the hue, saturation and lightness sliders, or type into any value field: #ff8800, 255, 136, 0 or 32, 100%, 50%.
  • Copy any format with its copy button. The Pygame field gives a tuple you can paste straight into screen.fill((255, 136, 0)).
  • Click a shade to use a lighter or darker version of the same hue, which is useful for highlights and shadows.
  • Save colour adds it to your palette (kept in this browser). Copy palette as Python produces a list ready to paste into your game.

Colours in Pygame#

Pygame accepts colours in several forms, and they are interchangeable:

Python
screen.fill((255, 136, 0))                # RGB tuple, each value 0-255
screen.fill((255, 136, 0, 128))           # RGBA; alpha only matters on SRCALPHA surfaces
screen.fill("darkorange")                 # a named colour
screen.fill(pygame.Color("#ff8800"))      # a Color object from hex

pygame.Color also lets you read and change components: c = pygame.Color("#ff8800"); c.hsla gives hue, saturation, lightness and alpha, and c.lerp(other, 0.5) blends two colours.

Contrast#

The contrast figures compare the colour against white and black text using the WCAG formula. A ratio of at least 4.5:1 keeps text readable for most players, which matters for scores, menus and subtitles.

Building a game palette#

Games look more coherent with a small, fixed palette. Start with a dark colour for outlines and text, a light background, and two or three accents, then add a lighter and darker shade of each. Export the list and use names in your code:

Python
PALETTE = [(21, 35, 63), (36, 87, 166), (244, 197, 49)]
INK, BLUE, GOLD = PALETTE
↑ ↓ to moveEnter to openEsc to close