The pack
uiTextureWood
function uiTextureWood(options: UiTextureWoodOptions = {}): Pack<{}>
Pack ui-texture-wood: paints the wood texture once, as the picture ui-texture-wood (or ui-texture-<name>), for a
ui style's texture: 'wood' — or any sprite's. Its options cut different boards. Needs no other pack.
Helpers
woodTexture
function woodTexture(options: UiTextureWoodOptions = {}): { size: number; data: Uint8ClampedArray<ArrayBuffer> }
The wood as RGBA bytes, size × size, grey around a mid tone so a style's colour tints it, tiling seamlessly both
ways. Pure and deterministic: the same options give the same pixels.
Types
UiTextureWoodOptions
interface UiTextureWoodOptions
How the wood is cut. Every field optional.
name?: string— The picture isui-texture-<name>, and a style saystexture: '<name>'. Default 'wood'.size?: number— The tile's side, px. Default 256.planks?: number— Planks across one tile, top to bottom. Default 3.grain?: number— How strongly the grain shows, 0..1. Default 0.7.knots?: number— Knots in one tile. Default 2.seam?: number— The seam between planks, px; 0 runs them together. Default 3.seed?: number— Changes the boards without changing their kind. Default 1.


