@arsams/color-shades
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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",
// ]

Package Sidebar

Install

npm i @arsams/color-shades

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

12.4 kB

Total Files

6

Last publish

Collaborators

  • arsamsarabi