design-math-wasm
v0.1.9
Published
WASM bindings for design-math.
Readme
design-math-wasm
WASM bindings for design-math.
This package exposes the shared design-math API for JS runtimes where a native Node addon is not the right fit.
Install
npm install design-math-wasmPublic API
This package exposes:
convertColoranalyzeColorcontrastColormanipulateColormixColorsgenerateColorScalegenerateColorHarmonygeneratePalettegenerateSchemegenerateTypeScalegenerateFluidScalegenerateFluidTypequeryLetterSpacingconvertTypeUnitsgenerateShadowSystem
Example
const math = require('design-math-wasm')
const color = math.convertColor('#c96442')
console.log(color.css.oklch)
const fluid = math.generateFluidType({
minSize: 16,
maxSize: 24,
minVw: 320,
maxVw: 1440,
})
console.log(fluid.clamp)Notes
- Input option objects use
camelCase - Result objects keep the shared
snake_casefield names - The result shape is intended to stay aligned with CLI
--json
For the full JS integration guide, see ../../docs/javascript-bindings.md.
License
This package is licensed for free use, copying, and redistribution in unmodified form for personal or commercial purposes. Modification and derivative works are not permitted. See LICENSE for the full terms.
