UNPKG

@material-vega/core

Version:

Material Design stylized themes for Vega Lite visualizations

16 lines (15 loc) 430 B
// import * as colorString from 'color-string'; // /** // * Extracts the alpha value of a color // * Returning an opaque rgb color and an alpha value // */ // export const extractColorAlpha = ( // color: string // ): { color: string; alpha: number } => { // const rgba = colorString.get.rgb(color); // const rgb = rgba.slice(0, 3); // return { // color: colorString.to.rgb(rgb), // alpha: rgba[3] // }; // };