Write a palette out
Turn a palette into code or into a file for a drawing program, to copy it or to save it.
On this page
Write it out
- Open the palette, and press Write it out…
- Choose the format in As. The text shows below.
- Press Copy, or Save to a file… to choose where it goes.
The formats
| Format | What it is | File |
|---|---|---|
| CSS variables | A :root with a variable per colour | .css |
| SCSS variables | A $ variable per colour | .scss |
| JSON | An object with the names and their colours | .json |
| A list | A colour per line, with its name | .txt |
| For drawing programs (GPL) | A palette that GIMP, Inkscape and Krita read | .gpl |
A palette with the colours "Green" and "Text on dark" is written in CSS like this:
:root {
--green: #9ad959;
--text-on-dark: #f3f3ee;
}How the names change
In CSS, SCSS and JSON, the name of a colour becomes one that code accepts: small letters without accents, digits and dashes. "Añil / Azul" is anil-azul.
- A colour without a name is called by its place:
colour-3. - Two colours with the same name are told apart by a number:
greenandgreen-2.
The list and the GPL file keep the names as you wrote them.
Colours that are not solid
They are written with eight digits, such as #9ad95980.
The GPL format has no place for how solid a colour is, so all of them go there solid.
Move your palettes to another computer
Save each palette with A list, which keeps the names and how solid each colour is, and read it there. A palette read from a list is named after its file.