Module

x/canvas/mod.ts>ColorMatrixHelpers

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

Methods

concat(outer: SkColorMatrix, inner: SkColorMatrix): SkColorMatrix

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

identity(): SkColorMatrix

Returns an identity SkColorMatrix.

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

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,
): SkColorMatrix

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

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

Returns a new SkColorMatrix that scales the colors as specified.