gl-react-color-blending
v2.0.5
Published
Color blending for gl-react (with Photoshop blend modes)
Downloads
21
Maintainers
Readme
gl-react-color-blending
Color blending shaders for gl-react and gl-react-expo.
Implementations from jamieowen/glsl-blend.
Check out the example React Native app in the examples
folder.
cd examples/color-blending && npm install && npm start
Install
npm install gl-react gl-react-color-blending --save
Usage
import ColorBlending from 'gl-react-color-blending';
<ColorBlending
color={color}
blendMode={blendMode}
>
https://i.imgur.com/iPKTONG.jpg
</ColorBlending>
color
: must be a array
with the length of 4 (RGBA format). Values must be a real value between 0 and 1.
For example, this is greenish: [0.1, 0.9, 0.1, 1]
blendMode
is a string, one of the followings:
blendAdd
blendAverage
blendColorBurn
blendColorDodge
blendDarken
blendDifference
blendExclusion
blendHardLight
blendHardMix
blendLighten
blendLinearBurn
blendLinearDodge
blendLinearLight
blendMultiply
blendNegation
blendNormal
blendOverlay
blendPhoenix
blendPinLight
blendReflect
blendScreen
blendSoftLight
blendSubstract
blendSubtract
blendVividLight
Other API
import ColorBlending, { blendNames, blendShaderCodes } from 'gl-react-color-blending';
blendNames
: Every supported blend mode as an array of strings.
blendShaderCodes
: Shader codes in plain text (glsl code). You can inject it to your own shader.
Licence
MIT