UNPKG

style-dictionary-utils

Version:
15 lines (14 loc) 391 B
import { toRgba } from 'color2k'; import { isColor } from '../filter/isColor.js'; import { getValue } from '../utilities/getValue.js'; /** * colorToRgba * @description convert a token of type `color` to a rgba value */ export const colorToRgba = { name: 'color/rgba', type: `value`, transitive: true, filter: isColor, transform: (token) => toRgba(getValue(token)), };