View as Markdown

API reference

@salmonui/export/graphics

11 exported symbols: 4 functions, 4 interfaces and 3 types. Each name links its page with the signature, docs and members. Names re-exported from another entry point are listed there, linked below.

import { … } from '@salmonui/export/graphics';

Functions

  • parseColorParses a CSS color as browsers serialize computed values (hex, rgb(), hsl(), oklch(), oklab(), color(srgb ...), a few names); null for none, transparent and an…
  • parseSvgXmlA small, forgiving XML reader for SVG (no DTDs, no namespaces beyond prefixes).
  • pathOpsSVG path data to absolute PDF path operators under m (arcs and quadratics become cubics).
  • writeGraphicsPdfWrites SVG drawings as a vector PDF, one page per drawing, each scaled to fit the page.

Interfaces

Types

  • RgbasRGB 0..1 plus alpha.

Re-exported entry points