Skip to main content
Module

x/canvas/mod.ts>ColorMatrixHelpers

Canvas API for Deno, ported from canvaskit-wasm (Skia).
Latest
interface ColorMatrixHelpers
import { type ColorMatrixHelpers } from "https://deno.land/x/canvas@v1.4.1/mod.ts";

Methods

concat(outer: ColorMatrix, inner: ColorMatrix): ColorMatrix

Returns a new ColorMatrix that is the result of multiplying outer*inner

identity(): ColorMatrix

Returns an identity ColorMatrix.

postTranslate(
dr: number,
dg: number,
db: number,
da: number,
): ColorMatrix

Sets the 4 "special" params that will translate the colors after they are multiplied by the 4x4 matrix.

rotated(
axis: number,
sine: number,
cosine: number,
): ColorMatrix

Returns a new ColorMatrix that is rotated around a given axis.

scaled(
redScale: number,
greenScale: number,
blueScale: number,
alphaScale: number,
): ColorMatrix

Returns a new ColorMatrix that scales the colors as specified.