UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

13 lines (10 loc) 224 B
import { parseColor } from '@antv/g'; export type Color = { r: number; g: number; b: number; }; export function parseToRGB(c: string | Color): Color { if (typeof c === 'object') return c; return parseColor(c); }