CSS Color Generator

Pick a colour and copy it as CSS — colour, background, border and variables. Runs entirely in your browser.

Colour#15803d
colorcolor: #15803d;
backgroundbackground-color: #15803d;
borderborder: 1px solid #15803d;
variable--brand: #15803d;
rgbrgb(21, 128, 61)
hslhsl(142, 72%, 29%)

Processed on your device. This file is never uploaded.

  1. 1Pick a colour.
  2. 2Choose the snippet you need.
  3. 3Copy it into your stylesheet.

From a colour to usable CSS

Once you have a colour, you still have to write it into CSS in the right property. This tool takes a colour and hands you each common form — as text colour, background, border, and a reusable custom property — plus its rgb() and hsl() equivalents, all ready to paste.

Generated locally

The snippets are produced in your browser with nothing uploaded, so it is a fast, private way to grab exactly the CSS you need for a colour.

Frequently asked questions