Color Shader
TheColorShader component returns a shader with a solid color. This is useful when you need to use a color as a shader input.
Props
| Name | Type | Description |
|---|---|---|
| color | Color | The color value (supports CSS color strings and hex numbers) |
Example
Using with Other Components
Color shaders can be used anywhere a shader is expected:Blend Shader
TheBlend component combines multiple shaders using a blend mode. This allows you to create complex visual effects by blending different shader outputs.
Props
| Name | Type | Description |
|---|---|---|
| mode | BlendMode | The blending mode to use (see blend modes) |
| children | ReactNode | The shaders to blend together |
Example
Available Blend Modes
The following blend modes are available:Porter-Duff Modes
clear, src, dst, srcOver, dstOver, srcIn, dstIn, srcOut, dstOut, srcATop, dstATop, xor, plus
Separable Blend Modes
modulate, screen, overlay, darken, lighten, colorDodge, colorBurn, hardLight, softLight, difference, exclusion, multiply
Non-Separable Modes
hue, saturation, color, luminosity
Custom Modes
plusDarker, plusLighter
For detailed descriptions of each mode, see Blend Modes.
Blending Multiple Shaders
You can blend more than two shaders by nestingBlend components:
Color Values
All color properties support multiple formats:Creating Effects with Blending
Multiply for Darkening
Screen for Lightening
Difference for Inversion
See Also
- Blend Modes - Detailed blend mode reference
- Gradients - Using gradient shaders
- Paint Properties - Paint color properties
- Image Shaders - Using images as shaders