generate-palette
v2.0.0
Published
Generate palette from input color
Readme
generate-palette
Generate a color palette based on an input color and step value.
Installation
This package is available on npm.
Install locally:
npm install generate-paletteInstall globally:
npm install -g generate-paletteTypeScript Support
This package includes TypeScript type definitions for improved auto-completion and type safety.
To ensure compatibility, install the Node.js type definitions:
npm install @types/nodeUsage
Importing the module
const generatePalette = require('generate-palette');API
generatePalette(color, step) → Object
Generates a color palette based on the given color and step value.
Parameters:
color(string) – The base color in HEX format.step(number, optional) – The intensity step for the palette, ranging from0to100.
Returns:
An object containing the generated color palette.
Examples
Example: Generate a color palette in JavaScript
const generatePalette = require('generate-palette');
const palette = generatePalette('#FFDD00', 10);
console.log(palette);Example: CLI Usage
Generate a palette using the CLI
generate-palette --color '#87CEEB' --step 10Output results in JSON format
generate-palette --color '#FFDD00' --step 10 --jsonLicense
This project is licensed under the MIT License.
