Skip to main content
Module

x/canvas/mod.ts>InputFlexibleColorArray

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

Some APIs accept a flattened array of colors in one of two ways - groups of 4 float values for r, g, b, a or just integers that have 8 bits for each these. CanvasKit will detect which one it is and act accordingly. Additionally, this can be an array of Float32Arrays of length 4 (e.g. Color). This is convenient for things like gradients when matching up colors to stops.

definition: Float32Array | Uint32Array | Float32Array[]