# generate-palette

> Generate palette from input color

Latest version **2.0.0** (published 2025-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install generate-palette
pnpm add generate-palette
yarn add generate-palette
bun add generate-palette
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2025-03-27 |
| First published | 2023-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 56.4 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Nazarii Borbiuk |
| Maintainers | nborbiuk |

## Links

- npm: https://www.npmjs.com/package/generate-palette
- Repository: https://github.com/borbiuk/generate-palette
- Homepage: https://github.com/borbiuk/generate-palette#readme
- Issues: https://github.com/borbiuk/generate-palette/issues
- npm.io page: https://npm.io/package/generate-palette

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) 4.17.21
- [minimist](https://npm.io/package/minimist.md) 1.2.8
- [chroma-js](https://npm.io/package/chroma-js.md) 3.1.2

## Recent versions

- 2.0.0 (latest) — 2025-03-27
- 1.0.4 — 2024-03-15
- 1.0.2 — 2023-01-24

## README

# generate-palette

Generate a color palette based on an input color and step value.

## Installation

This package is available on [npm](https://www.npmjs.com/).

### Install locally:

```sh
npm install generate-palette
```  

### Install globally:

```sh
npm install -g generate-palette
```  

## TypeScript Support

This package includes TypeScript type definitions for improved auto-completion and type safety.

To ensure compatibility, install the Node.js type definitions:

```sh
npm install @types/node
```  

## Usage

### Importing the module

```js
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 from `0` to `100`.

##### Returns:
An object containing the generated color palette.

## Examples

### Example: Generate a color palette in JavaScript

```js
const generatePalette = require('generate-palette');

const palette = generatePalette('#FFDD00', 10);
console.log(palette);
```  

<img src="palette.png" alt="Generated color palette" width="320px"/>  

### Example: CLI Usage

#### Generate a palette using the CLI

```sh
generate-palette --color '#87CEEB' --step 10
```  

#### Output results in JSON format

```sh
generate-palette --color '#FFDD00' --step 10 --json
```  

## License

This project is licensed under the [MIT License](LICENSE).

---
_Source: https://npm.io/package/generate-palette · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
