# easy-palette

> an easy way to generate color palette, based on color theory

Latest version **1.1.9** (published 2023-12-06) · ISC license · 0 weekly downloads

## Install

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

## 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.9 |
| Published | 2023-12-06 |
| First published | 2023-10-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Adrian Purnama |
| Maintainers | adr-ian |
| Keywords | color, colorpalette, colortheory, generate, colorgenerate, colorgeneration, colorwheel, colorpalettegenerator, palette, palettegenerator |

## Links

- npm: https://www.npmjs.com/package/easy-palette
- Repository: https://github.com/ADR-ian-ba/easy-palette
- Homepage: https://github.com/ADR-ian-ba/easy-palette#readme
- Issues: https://github.com/ADR-ian-ba/easy-palette/issues
- npm.io page: https://npm.io/package/easy-palette

## 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.9 (latest) — 2023-12-06
- 1.1.8 — 2023-10-16
- 1.1.7 — 2023-10-16
- 1.1.6 — 2023-10-16
- 1.1.5 — 2023-10-13
- 1.0.5 — 2023-10-13

## README

![image](https://github.com/ADR-ian-ba/easy-palette/blob/main/Colorgen%20Logo%20Fix-01.png?raw=true)
# Color-Palette Generator 🎨

A simple package allowing you to create color s easily.

## About 📰

Hi i am adrian, a college student wanting to do stuff, this package will allow you to create color palette easily, even knowing the name of the color given.

## installation 🌏
for javascript you can install using npm install (i)
```javascript
npm install @adr-ian/color-palette

```

## usage 📰

### color Palette Generation 🌈
generate simple color palette
```js
import {Analogus} from "color-palette"

let color = Analogus(10)
```
this will generate a random color palette using **Analogus** color theory
```
[ [ '267ef0' ],[ 'b324e3' ],[ 'fa202f' ],[ '000000' ],[ '074219' ] ]
```
![My Logo](https://github.com/ADR-ian-ba/color-palette/blob/main/gradient.png?raw=true)
**Generation method**
* Monochromatic
* Analogus
* Square
* Triadic
* Complimentary

#### Parameters
there is 6 parameter. 1 Parameter for **Amount of Color** is mandatory, and the other is
* Hex (default is **True**)
* RGB (default is **False**)
* CMYK (default is **False**)
* HSB (default is **False**)
* Real Name (default is **False**)

```js
import {Analogus} from "color-palette"

let color = Monochromatic(10, {
    hex: true, 
    rgb: true, 
    cmyk: true, 
    realName: true, 
    hsb: true
})
```
the code provided will generate data as follows
```js
let color = [
 [
    '281e5e', //hex
    [ 40, 30, 94 ], //rgb
    [ 57, 68, 0, 63 ], //cmyk
    [ 249, 68, 37 ], //hsb
    'Intergalactic Cowboy' //real name
  ]
]
```


### Color Blindness Manipulation 🦯
currently this package support 7 type of color blindness

##### Color blindness support
* Protanopia (weak red)
* Deuteranopia (weak green)
* Tritanopia (weak blue)
* Protanomaly (Blind red)
* Deuteranomaly (Blind green)
* Tritanomaly (Blind blue)
* Achromatopsia (Total Color Blindness)

to use, put "simulate" in front of the color blindness, and the para meter will be rgb, and the result will be a list of **[R, G, B]**

```js
import {simulateProtanopia} from "color-palette"

let colorBlind = simulateProtanopia(250,202,56)

//colorBlind = [ 229, 228, 91 ]

//simulateProtanopia (r, g b)
//simulateDeuteranopia (r, g b)
//simulateTritanopia (r, g b)
//simulateProtanomaly (r, g b)
//simulateDeuteranomaly (r, g b)
//simulateTritanomaly (r, g b)
//simulateAchromatopsia (r, g b)
```
![Alt text](https://github.com/ADR-ian-ba/color-palette/blob/main/colorblind.png?raw=true)
### Color Conversion Support 💁‍♂️
this package also helps you to convert color from one type to other type

##### Color Conversion Support
* **HSB** to **HEX**
* **HSB** to **RGB**
* **HSB** to **CMYK**
* **HEX** to **RGB**
* **RGB** to **HEX**

```js
import {hsbToHex} from "color-palette"

let color = hsbToHex(h, s, b)

// let color = hsbToCmyk(h, s, b)
// let color = hsbToRgb(h, s, b)
// let color = hexToRgb(hex)
// let color = rgbToHex(r, g, b)

//hex = 'faca38'
//rgb = [r, g, b]
//cmyk = [c, m, y, k]
//hsb = [h, s, b]
```

the return will be a list, excepet for hex, hex result will be the hex code without the "#"

### Color Naming Support 🔥

this package support name to color, with precision of **30.200** color, this also takes refrence from [NTC.Js](https://chir.ag/projects/ntc/).

![Alt text](https://github.com/ADR-ian-ba/color-palette/blob/main/image-1.png?raw=true)

```js
import {ntc} from "color-palette"

let colorName  = ntc.name("faca38")
//colorName = sunGlow
```

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