This is an example showing how to transform Design tokens into color palettes usable by designers:
.sketchpalette
: Sketch (with the sketch-palettes plugin)
This repository uses Material Design Colors as an example. Follow these steps to generate palettes with your own colors:
-
In a terminal, type:
git clone https://github.com/kaelig/tokens2palettes-example
(or clone your own fork of this repository)
-
Open
package.json
and change the value ofpalettename
to something else:"config": { "palettename": "Material Design" },
-
Define the color palette in
./tokens/colors.yml
following the design tokens specification. -
Generate the color palettes:
yarn yarn dist
-
That’s it! Color palettes are in the
./dist
folder.
- The script uses Theo to consume tokens from
./tokens/colors.yml
. Custom formats forase
andsketchpalette
are passed to the Theo v6 command line interface, which does the rest and outputs files to./dist
. - Then,
ase2clr
takes thease
file and exports it into aclr
file - Finally, the script renames all of the
colors.*
files something more human-friendly that designers will appreciate.