Developer Tools

CSS Color Extractor with Worked Examples

Pull every hex, rgb() and hsl() colour out of a stylesheet. Enter css and read the result straight away. Example: “.btn{color:#fff;background:#2563eb;border:1px solid rgba(0,0,0,.1)}.card{background:hsl…” gives “#fff / #2563eb / rgba(0,0,0,.1) / hsl(210,40%,98%)”. A slash marks a line break.

01

Your inputs

Start with the example, or enter your own values.

Processed in your browser. Your inputs stay on this device.

02

Your result

A little clarity, coming right up.

Make room for the answer.

Enter your values and run the tool. Your result will appear here.

How to use the CSS Color Extractor

Paste CSS. Each distinct colour is listed once in the order it appears.

Examples

  • With the default values
    #fff
    #2563eb
    rgba(0,0,0,.1)
    hsl(210,40%,98%)

Limitations and assumptions

Confirm assumptions, units and applicable local rules before relying on results. Detailed content, accessibility and edge-case review remains ongoing.

Frequently asked questions

What does the CSS Color Extractor do?

Pull every hex, rgb() and hsl() colour out of a stylesheet.

How does the CSS Color Extractor work?

Paste CSS. Each distinct colour is listed once in the order it appears.

What should I keep in mind when using the CSS Color Extractor?

Confirm assumptions, units and applicable local rules before relying on results.

Can I see an example of the CSS Color Extractor?

Example: “.btn{color:#fff;background:#2563eb;border:1px solid rgba(0,0,0,.1)}.card{background:hsl…” gives “#fff / #2563eb / rgba(0,0,0,.1) / hsl(210,40%,98%)”. A slash marks a line break.

Is the CSS Color Extractor free to use?

Yes. It is free, needs no account and runs in your browser.