# @react-vertex/hex-webgl

> Convert hex colors to WebGL friendly format

Latest version **1.1.0** (published 2019-04-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @react-vertex/hex-webgl
pnpm add @react-vertex/hex-webgl
yarn add @react-vertex/hex-webgl
bun add @react-vertex/hex-webgl
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-04-20 |
| First published | 2019-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1234 |
| Author | Steven Hall |
| Maintainers | sghall |
| Keywords | colors, hex, webgl |

## Links

- npm: https://www.npmjs.com/package/@react-vertex/hex-webgl
- Repository: https://github.com/sghall/react-vertex
- Homepage: https://github.com/sghall/react-vertex/tree/master/packages/hex-webgl#readme
- Issues: https://github.com/sghall/react-vertex/issues
- npm.io page: https://npm.io/package/@react-vertex/hex-webgl

## Dependencies (2)

- [hex-rgb](https://npm.io/package/hex-rgb.md) ^4.0.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.4.3

## 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.0 (latest) — 2019-04-20
- 1.0.0 — 2019-04-08
- 0.4.0 — 2019-04-07
- 0.3.0 — 2019-04-04
- 0.2.0 — 2019-04-04
- 0.1.11 — 2019-03-29

## README

# `@react-vertex/hex-webgl`

[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/sghall/react-vertex/blob/master/packages/hex-webgl/LICENSE)
[![bundlephobia](https://badgen.net/bundlephobia/minzip/@react-vertex/hex-webgl)](https://bundlephobia.com/result?p=@react-vertex/hex-webgl)
[![npm version](https://img.shields.io/npm/v/@react-vertex/hex-webgl.svg)](https://www.npmjs.com/package/@react-vertex/hex-webgl)

### [Documentation and Examples](https://react-vertex.com)

Simple helper function to convert hex colors to a WebGL friendly format.

```
import convertHex from '@react-vertex/hex-webgl'

convertHex('#fff')
// [1, 1, 1, 1]

convertHex('#0006')
// [0, 0, 0, 0.4]

convertHex('#4183c4')
// [0.2549019607843137, 0.5137254901960784, 0.7686274509803922, 1]

convertHex('#4183c4', true) // Drop the alpha by passing true as a second param 
// [0.2549019607843137, 0.5137254901960784, 0.7686274509803922]

gl.clearColor(...convertHex('#323334'))
```

---
_Source: https://npm.io/package/@react-vertex/hex-webgl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
