# create-pixel

> Helper function to reate data-uri of a one pixel image with custom color

Latest version **0.1.0** (published 2019-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-pixel
pnpm add create-pixel
yarn add create-pixel
bun add create-pixel
```

## 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.1.0 |
| Published | 2019-02-08 |
| First published | 2019-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | unknown |
| Maintainers | pandaiolo |
| Keywords | create, pixel, image, color, alpha, transparency |

## Links

- npm: https://www.npmjs.com/package/create-pixel
- Repository: https://github.com/pandaiolo/create-pixel
- Homepage: https://github.com/pandaiolo/create-pixel#readme
- Issues: https://github.com/pandaiolo/create-pixel/issues
- npm.io page: https://npm.io/package/create-pixel

## 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

- 0.1.0 (latest) — 2019-02-08

## README

# create-pixel

Helper function to reate data-uri of a one pixel image with custom color

# Credits

Copied from unkown author from this SO answer: https://stackoverflow.com/a/33919020/1644131

# Setup

With `npm`:

```
npm install create-pixel
```

With `yarn`:

```
yarn add create-pixel
```

# Usage

```js
import createPixel from 'create-pixel'

// Other option with a number: createPixel(0xff0000)
const dataUri = createPixel('#ff0000')

// Use in a generated image src:
const onePixelImage = new Image()
onePixelImage.src = dataUri
document.body.appendChild(onePixelImage)

// Or in a JSX component:
<img src={dataUri} />
```

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