mermaid.pixel.paint

mermaid.pixel

paint(frame, opts) -> strips

Paint a frame's strokes into pixel strips

Returns one entry per row of the frame: { w, h, cols, rgba }, or false for a row with no ink. rgba is w * h * 4 bytes of straight RGBA, w pixels wide and h tall, to be shown over cols columns and one row.

opts:

FieldHolds
cell_w, cell_ha cell's size in pixels; 10 by 20 when not given
inksa colour for each style name, { r, g, b, a } from 0 to 255
strokea line's width in pixels; a tenth of cell_h when not given

An element is drawn in the ink of its style. inks["node.fill"] and inks["group.fill"], when given, fill a box and a group before their outlines are drawn. A style with no ink is drawn in light grey.

The frame must pass mermaid.frame.check. A text is not drawn: it is the caller's to write over the strips.