# canvas-pixel-color

> get color data of pixel from canvas

Latest version **1.0.2** (published 2014-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install canvas-pixel-color
pnpm add canvas-pixel-color
yarn add canvas-pixel-color
bun add canvas-pixel-color
```

## 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.2 |
| Published | 2014-09-14 |
| First published | 2014-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | meandave |
| Maintainers | meandave |
| Keywords | pixel, color, rgba, hex, data, canvas, event |

## Links

- npm: https://www.npmjs.com/package/canvas-pixel-color
- Repository: https://github.com/meandavejustice/canvas-pixel-color
- Issues: https://github.com/meandavejustice/canvas-pixel-color/issues
- npm.io page: https://npm.io/package/canvas-pixel-color

## 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.0.2 (latest) — 2014-09-14
- 1.0.1 — 2014-09-14
- 1.0.0 — 2014-09-14

## README

# Canvas-pixel-color

[![NPM](https://nodei.co/npm/canvas-pixel-color.png?downloads=true)](https://npmjs.org/package/canvas-pixel-color)

pass an event and canvas context and get back rgba and hex data.

## Usage
``` javascript
var canvasPixelColor = require('canvas-pixel-color');
var cvs = document.getElementById('myCanvas');
var ctx = cvs.getContext('2d');

cvs.addEventListener('mousemove', function(ev) {
  // returns {
  //   hex: ##ff0beb,
  //   rgba: [255, 11, 235, 115] // this is an actual Array
  // }
  console.log(canvasPixelColor(ev, ctx));
});

```

## Info
This is basically just pulled from [canvas-color-picker](https://github.com/JamesKyburz/canvas-colorpicker).
With some slight changes.

## License
(same as original project's) MIT License

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