1.1.0 • Published 5 years ago

@react-vertex/hex-webgl v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@react-vertex/hex-webgl

license bundlephobia npm version

Documentation and Examples

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'))
1.1.0

5 years ago

1.0.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.11

5 years ago