The pack
uiTexturePaper
function uiTexturePaper(options: UiTexturePaperOptions = {}): Pack<{}>
Pack ui-texture-paper: paints the crumpled-paper texture once, as the picture ui-texture-paper (or
ui-texture-<name>), for a ui style's texture: 'paper' — or any sprite's. Needs no other pack.
Helpers
paperTexture
function paperTexture(options: UiTexturePaperOptions = {}): { size: number; data: Uint8ClampedArray<ArrayBuffer> }
The paper as RGBA bytes, size × size, grey around mid grey so a style's colour tints it, tiling seamlessly both
ways. Pure and deterministic: the same options give the same pixels.
Types
UiTexturePaperOptions
interface UiTexturePaperOptions
How the paper is crumpled. Every field optional.
name?: string— The picture isui-texture-<name>, and a style saystexture: '<name>'. Default 'paper'.size?: number— The tile's side, px. Default 256.crumple?: number— How hard it was crumpled, 0 (smooth) to 1 (balled up). Default 0.6.fibres?: number— Fibres and specks, 0..1. Default 0.5.seed?: number— Changes the creases without changing their kind. Default 1.


