style-dictionary-utils
Version:
Utilities to use in your style dictionary config
19 lines (18 loc) • 668 B
TypeScript
import { PlatformConfig, Transform } from 'style-dictionary/types';
export type ColorTokenValue = {
colorSpace: string;
components: [number, number, number];
alpha?: number;
hex?: string;
};
export declare const colorValueTransformer: (colorValue: ColorTokenValue | string, platform: PlatformConfig | undefined) => string | {
r: number;
g: number;
b: number;
a: number;
};
/**
* colorToCss
* @description convert a token of type `color` to a css color value use platform.colorOutputFormat to determine the output format, if not provided defaults to `hex`, options are `hex`, `rgb`, `hsl`
*/
export declare const colorCss: Transform;