@arsams/color-shades
v0.1.2
Published
A simple package to generate shades of a color
Downloads
20
Maintainers
Readme
color-shades
Installation
pnpm add @arsams/color-shades
Usage
import { getShades, type GetShadesInput } from "@arsams/color-shades";
const shades = getShades({
amount: 0.1, // number between 0 and 1 (default: 0.1)
color: "#bada55", // base color
count: 10, // number of shades (default: 10)
mode: "both", // color mode (default: 'both') (lighten | darken | both)
output: "hex", // output format (default: 'hex') (hex | rgb | hsl)
});
console.log(shades);
// [
// "#e2f0b9",
// "#d4e996",
// "#c7e276",
// "#bbdc5a",
// "#bada55",
// "#b0d53c",
// "#a4ca2c",
// "#94b628",
// "#85a424",
// "#789420",
// ]