convert-color
This parser helps you convert the color formats of color compatible tokens over a SDTF graph.
Interface
interface parser {
name: 'convert-color';
options: {
toFormat:
| 'hex'
| 'rgb'
| 'hsl'
| 'hsb'
| 'lch'
| 'lab';
applyTo?:
| { collection: string | true }
| { group: string | true }
| { token: string | true }
| SDTFQuery;
};
}Options
Parameter
Required
Type
Default
Description
toFormat
required
The target color format to convert to. Actual value conversion is done by the colord package.
applyTo
false
The selection where to apply the transformation.
collection, group, token take a Regex string or true to select anything of the kind.
An SDTFQuery can be used for advance use cases.
Basic usage
We convert all colors from our SDTF graph in hsl.
We then generate our transformed SDTF graph in a JSON file thanks to the to-sdtf parser.
Last updated
Was this helpful?