canvaskit-wasm 0.39
build 2026-04-29
ColorMatrixHelpers
CK.ColorMatrix is a namespace of helpers for building 4×5 row-major color matrices passed to ColorFilter.MakeMatrix. Each helper returns a plain number[20].
Error: Line 1: Unexpected identifier
Members
| Member | Args | Returns | Notes |
|---|---|---|---|
concat | outer, inner: number[20] | number[20] | Combine two color matrices (outer × inner). |
identity | — | number[20] | 4×5 identity (no-op). |
postTranslate | m: number[20], dr, dg, db, da: number | number[20] | Add per-channel bias to the matrix's last column. |
rotated | axis: number, sine: number, cosine: number | number[20] | Hue rotation around an axis (0=R, 1=G, 2=B). Pass pre-computed sin(θ), cos(θ) — not the angle. |
scaled | r, g, b, a: number | number[20] | Per-channel scale. |
See also
ColorFilter.MakeMatrix— consumes the result.ColorFilter.