Gleam - v1.0.2
    Preparing search index...

    Function changeColor

    • Recolor an opaque canvas in place using composite operations, preserving the alpha mask of the source image. Wraps the body in save/restore so fillStyle / globalCompositeOperation writes don't leak to the caller's context. https://stackoverflow.com/a/45201094

      Parameters

      • context: CanvasRenderingContext2D
      • oriImg: HTMLCanvasElement
      • newColor: string

      Returns void