animator.graphics.shader.ShaderBlender

class animator.graphics.shader.ShaderBlender(mode: Union[animator.skia.BlendMode, animator.skia.Blender, Literal['source-over', 'source-in', 'source-out', 'source-atop', 'destination-over', 'destination-in', 'destination-out', 'destination-atop', 'lighter', 'copy', 'xor', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']])

Bases: object

Blends multiple shaders together using a blend mode.

>>> ShaderBlender('color')[
...     shader1,
...     shader2,
...     ...
... ]
__init__(mode: Union[animator.skia.BlendMode, animator.skia.Blender, Literal['source-over', 'source-in', 'source-out', 'source-atop', 'destination-over', 'destination-in', 'destination-out', 'destination-atop', 'lighter', 'copy', 'xor', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']]) None

Create a blender to blend shaders using the given blend mode.

Methods

Arithmetic(k1, k2[, k3, k4, enforce_premul])

Create a blender that uses the given arithmetic coefficients.

__init__(mode)

Create a blender to blend shaders using the given blend mode.

blend(dst, src)

Blend the given src shader into the given dst shader.

classmethod Arithmetic(k1: float, k2: float, k3: Optional[float] = None, k4: Optional[float] = None, /, enforce_premul: bool = False) animator.graphics.shader.ShaderBlender

Create a blender that uses the given arithmetic coefficients.

blend(dst: animator.skia.Shader, src: animator.skia.Shader) animator.skia.Shader

Blend the given src shader into the given dst shader.