gl-react-color-blending
Color blending shaders for gl-react-native.
Implementations from here: glsl-blend.
Check out the example React Native app in the example
folder.
Install
npm install gl-react-color-blending --save
Usage
import ColorBlending from 'gl-react-color-blending';
<ColorBlending
color={color}
blendMode={blendMode}
>
<Image ... />
</ColorBlending>
Color: must be a array
with the length of 4 (RGBA format). Values must be [0..1].
Color example: [0.1, 0.9, 0.1, 1] // greenish
Blend mode is a string.
Supported blend modes:
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, {getAllBlendNames, blendModeCodes} from 'gl-react-color-blending';
getAllBlendNames
: Every supported blend mode name in an array.
blendModeCodes
: Shader codes in plain text (glsl code). You can inject it to your own shader code with ES2015 template strings.
Licence
MIT