melonJS
    Preparing search index...

    Class ColorMatrixEffect

    A shader effect that applies a 4x4 color transformation matrix. Provides chainable color adjustment methods that automatically update the GPU uniform.

    Renderable.shader for usage

    // desaturate a sprite
    mySprite.shader = new ColorMatrixEffect(renderer).saturate(0.0);
    // combine brightness + contrast on a camera
    camera.shader = new ColorMatrixEffect(renderer).brightness(1.3).contrast(1.5);
    // update dynamically
    effect.reset().brightness(1.5).saturate(0.5);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _enabledBeforeSuspend: boolean | undefined
    destroyed: boolean = false

    true once destroy has been called. Distinct from enabled — which also toggles transiently across a context lost / restored cycle — to give callers a stable signal for "this effect has been explicitly released."

    enabled: boolean = false

    whether this effect is active (false in Canvas mode, false after destroy, and false while the WebGL context is suspended between an ONCONTEXT_LOST and the matching ONCONTEXT_RESTORED event).

    Methods