Expand description
Portable paint primitives — Color and Stroke.
These types are the kernel’s framework-agnostic color + stroke
vocabulary. Host painters convert to backend-specific types
(egui Color32, iced Color, vello / wgpu colors) at the draw-
call boundary; portable descriptors flow through kernel’s
overlay surface (OverlayStrokePass), through host-contract
ports, and through graph-canvas’s packet::SceneDrawItem /
node_style / derive surfaces — all without coupling the kernel
to a renderer crate.
Why these live in kernel, not graph-canvas: previously
they lived in graph_canvas::packet, with kernel importing
them — that made kernel → graph-canvas an upward dependency
that blocked the
cartography layer
brief’s revised §9 step 4 (the graph-layout extraction).
Moving these into the kernel and having graph-canvas re-export
them reverses the edge to its natural direction (kernel is
foundational; everything else depends on it). The graph-canvas
public API stays stable through the re-export.
§Coexistence with color::Color32
The kernel also has crate::color::Color32 — an u8-channel
color type used for egui-shaped host palettes (drag-preview
tinting, etc.). Color in this module is the f32-channel form
used for renderer-style descriptors. The two coexist by design:
Color32 is the kernel’s host-palette type; Color is the
kernel’s renderer-descriptor type. A future cleanup may unify
them; for now both ship.