$ cnpm install @antv/smart-color
$ npm install @antv/smart-color
import { paletteGeneration } from '@antv/smart-color';
paletteGeneration("monochromatic", {
color: {
model: "rgb",
value: { r: 91, g: 143, b: 249 },
},
count: 7,
tendency: "shade"
});
import { PaletteOptimization } from '@antv/smart-color';
const palette = {
name: "color4",
semantic: null,
type: "categorical",
colors: [
{ model: "rgb", value: { r: 101, g: 120, b: 155 }, },
{ model: "rgb", value: { r: 91, g: 143, b: 249 }, },
{ model: "rgb", value: { r: 97, g: 221, b: 170 }, },
{ model: "rgb", value: { r: 246, g: 189, b: 22 }, }
],
}
paletteOptimization(palette, {
locked: [true],
simulationType: "grayscale"
});
import { colorSimulation } from '@antv/smart-color';
const color = {
model: "rgb",
value: { r: 91, g: 143, b: 249 },
}
colorSimulation(color, "achromatomaly");
MIT
Copyright 2013 - present © cnpmjs.org | Home |