UNPKG

799 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.getColors = exports._variants = void 0;
4const utils_1 = require("./utils");
5exports._variants = {
6 50: utils_1.withTint(0.95),
7 100: utils_1.withTint(0.9),
8 200: utils_1.withTint(0.75),
9 300: utils_1.withTint(0.6),
10 400: utils_1.withTint(0.3),
11 500: c => c,
12 600: utils_1.withShade(0.9),
13 700: utils_1.withShade(0.6),
14 800: utils_1.withShade(0.45),
15 900: utils_1.withShade(0.3)
16};
17function getColors(color, variants = exports._variants) {
18 const colors = {};
19 const components = utils_1.parseColor(color);
20 for (const [name, fn] of Object.entries(variants)) {
21 colors[name] = utils_1.hexValue(fn(components));
22 }
23 return colors;
24}
25exports.getColors = getColors;