suf-canvas
v1.0.0
Published
Canvas Helper Classes.
Downloads
10
Readme
Canvas Wrappers to quickly visualize stuff.
Docs
canvasCache
CanvasCache
class CanvasCache {
canvas: HTMLCanvasElement;
ctx: CanvasRenderingContext2D;
constructor(size: number, name: string);
}
canvasViewer
CanvasViewer
class CanvasViewer extends CanvasCache {
size: number;
scale: number;
cssScale: number;
static viewers: number;
static container: HTMLDivElement;
constructor(size: number, scale?: number, cssScale?: number);
drawNumArray(arr: number[], colorMultiplier?: number): void;
drawRGBNumArray(arr: [number, number, number][], colorMultiplier?: number): void;
componentToHex(c: number): string;
rgbToHex(r: number, g: number, b: number): string;
}
canvasViewerRect
CanvasViewerRect
class CanvasViewerRect extends CanvasViewer {
rect: {
width: number;
height: number;
};
constructor(rect: {
width: number;
height: number;
}, scale?: number, cssScale?: number);
drawWaveArray(arr: number[], skip?: number): void;
}
Generated with suf-cli
Copyright (c) 2021 Leonard Grosoli Licensed under the MIT license.