# get-average-color

> Get average color from image in browser environment

Latest version **0.0.6** (published 2017-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-average-color
pnpm add get-average-color
yarn add get-average-color
bun add get-average-color
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2017-06-29 |
| First published | 2017-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | bashkos |
| Maintainers | bashkos |
| Keywords | image, color, palette, dominant, average, util, tool |

## Links

- npm: https://www.npmjs.com/package/get-average-color
- Repository: https://github.com/bashkos/get-average-color
- Homepage: https://github.com/bashkos/get-average-color#readme
- Issues: https://github.com/bashkos/get-average-color/issues
- npm.io page: https://npm.io/package/get-average-color

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2017-06-29
- 0.0.5 — 2017-06-29
- 0.0.4 — 2017-06-27
- 0.0.3 — 2017-06-27
- 0.0.2 — 2017-06-27
- 0.0.1 — 2017-06-27

## README

# get-average-color

[![npm version](https://badge.fury.io/js/get-average-color.svg)](https://badge.fury.io/js/get-average-color)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

> Get average color from image in browser environment

This package provides a function called `getAverageColor`, which returns in promise
the YUV average color of the image, whose url (or base64) will be passed as a
parameter.

![Preview](https://raw.githubusercontent.com/bashkos/get-average-color/master/preview.png)

## Install

```bash
$ npm i -S get-average-color
```

## Usage

```JavaScript
import getAverageColor from 'get-average-color'
import image from './img/myCoolImage.jpg'

getAverageColor(image).then(rgb => console.log(rgb)) // { r: 66, g: 83, b: 25 }
```

## Demo
Clone this repo, install all dependencies and then start the demo
```bash
$ git clone git@github.com:bashkos/get-average-color.git
$ cd get-average-color
$ npm install
$ npm start
```

## License
MIT.

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