# pal-it

> Pal.it is a simple library to pull a palette of colors from an image. This supports both node and browser environments.

Latest version **1.0.4** (published 2021-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install pal-it
pnpm add pal-it
yarn add pal-it
bun add pal-it
```

## 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.0.4 |
| Published | 2021-03-21 |
| First published | 2021-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 148.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nathan Sorkin |
| Maintainers | nathansrkn |

## Links

- npm: https://www.npmjs.com/package/pal-it
- Repository: https://github.com/NateSrkn/pal.it
- Homepage: https://github.com/NateSrkn/pal.it#readme
- Issues: https://github.com/NateSrkn/pal.it/issues
- npm.io page: https://npm.io/package/pal-it

## Dependencies (2)

- [jimp](https://npm.io/package/jimp.md) ^0.16.1
- [quantize](https://npm.io/package/quantize.md) ^1.0.2

## Recent versions

- 1.0.4 (latest) — 2021-03-21
- 1.0.3 — 2021-03-15
- 1.0.2 — 2021-03-15
- 1.0.1 — 2021-03-15
- 1.0.0 — 2021-03-15

## README

# Pal.it

Pal.it is a simple library to pull a palette of colors from an image. This supports both node and browser environments.

## Installation

```bash
npm install pal-it
```

```bash
yarn add pal-it
```

## Usage

```javascript
import Pal from "pal-it";

const defaultPal = new Pal("../photo.jpeg"); // Supports local files, urls and an HTML img element.
const customPal = new Pal("../photo.jpeg", { paletteSize: 10, quality: 10 }); // Custom paletteSize and search quality can be added

// Returns the dominant color from the photo
defaultPal.getDominantColor();

// These each return their respective palette in the requested format.
defaultPal.getHexPalette();
defaultPal.getRGBPalette();
defaultPal.getHSLPalette();

const sortOptions = {
  format: "lightness", // hue, saturation, lightness - Defaults to lightness
  order: "desc", // desc or asc for the order - Defaults to desc
  returnFormat: "hex", // rgb, hex, hsl - Defaults to hex
};

const sortedPalette = defaultPal.sortBy(sortOptions);
```

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