| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
NanoUI.Svg
Description
SVG documents for icons: a parser for the static subset icon sets use and an anti-aliased rasterizer.
Supported: svg (with viewBox, width, height), g, path, rect,
circle, ellipse, line, polyline and polygon; the presentation
attributes fill, stroke, stroke-width, stroke-linecap,
stroke-linejoin, stroke-miterlimit, fill-rule, opacity,
fill-opacity and stroke-opacity, also inside style; transform; and
colours as names, #rgb, #rrggbb, rgb() and currentColor. Gradients,
patterns, text, masks, clipping, filters and use are ignored.
Documentation
A parsed SVG document.
svgSize :: Svg -> (Float, Float) Source #
The document's own width and height, from its width and height or
else its viewBox.
svgMonochrome :: Svg -> Bool Source #
Every paint is currentColor or unspecified, so the drawing is one
colour and can be tinted.
rasterizeSvg :: Int -> Int -> Color -> Svg -> ByteString Source #
Render the document into a width by height RGBA image (rows top to
bottom), scaled to fit and centred as SVG's default xMidYMid meet does.
current is what currentColor, and an unspecified fill, paint with.