Skip to main content

Module paint

Module paint 

Source
Expand description

Turning a Map into pixels.

§Why there is a font in here

A treemap with no labels is a shape, not an answer. “Where are the bytes” is only answered if the big rectangle says which directory it is, and the terminal cannot help: a graphics image covers the cells it is placed over, so the text has to be in the image. Hence [FONT] — 95 glyphs of 5×7, which is the smallest thing that can spell node_modules legibly at the size a terminal cell gives.

§Colour is not the identity encoding, and that is deliberate

Rectangles are told apart by a 2 px surface gap and by their own labels, never by hue. A treemap’s neighbours are arbitrary — any tile can end up beside any other — so a palette used for identity here would have to clear the all-pairs colour-blindness gate, and no eight-hue palette does. So hue carries state instead, over exactly two slots that do clear it all-pairs on this surface (blue ↔ aqua, CVD ΔE 19.6): unmarked and marked. Depth is a lightness step within the hue, and “nobody has measured this” is texture rather than a third colour — which is also the right encoding for it, because texture is what a reader reads as absence of data rather than as another category.

Structs§

Canvas
An image, in the layout the graphics protocol’s f=24 wants: three bytes a pixel, rows top to bottom, no padding.

Functions§

paint
Paints a map at this pixel size.