# palette-generator

> A methodical approach for creating and managing color palettes.

Latest version **1.1.0** (published 2016-09-01) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-09-01 |
| First published | 2016-08-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Andy Carson |
| Maintainers | andycarson |
| Keywords | color, palette, generator |

## Links

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

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-09-01
- 1.0.6 — 2016-08-21
- 1.0.5 — 2016-08-15
- 1.0.4 — 2016-08-15
- 1.0.3 — 2016-08-15
- 1.0.2 — 2016-08-08
- 1.0.1 — 2016-08-08
- 1.0.0 — 2016-08-03

## README

`palette-generator` allows you to use simple color theory rules to create and maintain a color palette with consistant relationships between colors and shades.
Make high level adjustments to your palette while maintaining the same consistant relationships between colors.

### Installation
```
npm install palette-generator --save
```

### Usage

```js
paletteGenerator(hue, saturation, lightness [, options])
```

### Options
All options are optional.

#### scheme
_Default_: `"complementary"`

_Values_: `analogous`, `accentedAnalogous`, `complementary`, `dual`, `triadic`

The color theory rule set used to generate the palette.

#### hueIncrement
_Default_: `20`

The degree of hue variation between generated palette colors.

#### shadeVariation
_Default_: `"20%"`

The percentage variation in shades generated for each palette color.


### Palette structure

```js
{
  alpha: {
    lighter: "hsl()",
    light: "hsl()",
    base: "hsl()",     // initial color
    dark: "hsl()",     // shade variation of initial color
    darker: "hsl()"
 },
  beta: {
    lighter: "hsl()",
    light: "hsl()",
    base: "hsl()",     // generated palette color
    dark: "hsl()",     // shade variation of generated palette color
    darker: "hsl()"
 },
 etc...
}
```

### Example

```js
import paletteGenerator from 'palette-generator'

const palette = paletteGenerator(215, "74%", "58%", {shadeVariation: "20%",
                                                     hueIncrement: 15,
                                                     scheme: "accentedAnalogous"})

const styles = {
  box: {
    backgroundColor: palette.alpha.base
    borderColor: palette.beta.dark
    color: palette.delta.lighter
  }
}
```

### Available schemes

#### Analogous
Initial base color + two secondary colors selected adjacent to the initial base color on the color wheel.

#### Analogous (accented)
Initial base color + two secondary colors selected adjacent to the initial base color on the color wheel + 1 accent color selected from across the color wheel.

#### Complementary
Initial base color + three accent colors selected from across color wheel.

#### Dual
Initial base color + one secondary color selected adjacent to the initial base color + accent colors for both initial and secondary colors selected from across the color wheel.

#### Triadic
Initial base color + two accent colors selected from across color wheel.

### Related
Inspired by <a href="http://paletton.com" target="_blank">Paletton</a>

### TODO
+ Tests
+ Option to add custom colors
+ Accept/return color formats other than hsl

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