2016-12-27 00:02:07 +08:00
|
|
|
# glsl-util
|
2016-10-03 23:40:55 +08:00
|
|
|
|
|
|
|
## install
|
|
|
|
|
|
|
|
```
|
2016-12-27 00:02:07 +08:00
|
|
|
npm i git://github.com/ykob/glsl-util.git
|
2016-10-03 23:40:55 +08:00
|
|
|
```
|
|
|
|
|
2016-12-27 00:02:07 +08:00
|
|
|
## convertHsvToRgb and convertRgbToHsv
|
|
|
|
this is the function that convetts RGB to HSV. or is its opposite.
|
|
|
|
|
|
|
|
### Quote source
|
|
|
|
|
|
|
|
http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
|
|
|
|
|
|
|
|
### usage
|
2016-10-03 23:40:55 +08:00
|
|
|
|
|
|
|
```
|
2016-12-27 00:19:28 +08:00
|
|
|
#pragma glslify: convertHsvToRgb = require(glsl-util/convertHsvToRgb);
|
|
|
|
#pragma glslify: convertRgbToHsv = require(glsl-util/convertRgbToHsv);
|
|
|
|
```
|
|
|
|
|
|
|
|
## random
|
|
|
|
|
|
|
|
### usage
|
|
|
|
|
|
|
|
```
|
|
|
|
#pragma glslify: random = require(glsl-util/random);
|
2016-10-03 23:40:55 +08:00
|
|
|
```
|