UNPKG

m3-svelte

Version:

M3 Svelte implements the Material 3 design system in Svelte. See the [website](https://ktibow.github.io/m3-svelte/) for demos and usage instructions.

14 lines (13 loc) 496 B
import { MaterialDynamicColors } from "@material/material-color-utilities"; import { colors } from "./utils"; /** * @description Serializes the {@link DynamicScheme} so that it can be used by {@link StyleFromScheme} and {@link genCSS}. * @param scheme The theme generated by material-color-utils. * */ export const serializeScheme = (scheme) => { const out = {}; for (const color of colors) { out[color] = MaterialDynamicColors[color].getArgb(scheme); } return out; };