glsl-gamma
Convenience utilities for working in linear space when dealing with sRGB textures.
# toLinear = require('glsl-gamma/in') # toGamma = require('glsl-gamma/out') void
Currently all gamma operates on a 2.2
constant.
Usage
toLinear = require('glsl-gamma/in')
genType = toLinear(genType color)
Take a sRGB value and return its linear form. For vec4
, the alpha component is left unchanged.
This is also the default export of glsl-gamma
.
toGamma = require('glsl-gamma/out')
genType = toGamma(genType color)
Takes a linear value and return its gamma-corrected (sRGB) form. For vec4
, the alpha component is left unchanged.
License
MIT. See LICENSE.md for details.