Documentation
¶
Overview ¶
Package livery holds the canonical pixel-grid definitions of abcd's visual identity — the duckling mascot, the signal-flag logo, and the lifeboat mark — and the palette they share (itd-133/spc-36). It is the single source of truth for every rendered artifact: the committed SVG assets under docs/assets/img/livery/ are generated from these grids and a package test regenerates and byte-compares them, so a hand edit to either side fails the gate. Terminal rendering (itd-112) consumes the same grids and palette keys; nothing in this package writes to a terminal.
The package is named for a vessel's livery — its distinctive colors and markings — because "identity" already means two other things in this codebase (the git-author gate and the positioning block).
Index ¶
Constants ¶
const ( // PanelColor is the dark panel behind the panel variants. Pixels keyed // 'k' are this color by design, so eyes read as holes in the panel. PanelColor = "#1c1f26" // TransparentEyeColor replaces 'k' on surfaces with no panel behind the // art — without it the face vanishes. Any consumer rendering the grids // onto its own background (itd-112's terminal work included) must make // the same substitution; Palette alone does not carry this rule. TransparentEyeColor = "#1f2328" )
SVG rendering constants. The output must stay deterministic — fixed cell ordering, no timestamps, no floating point — because the drift gate byte-compares regenerated output against the committed files.
const Reset = "\x1b[0m"
Reset is the SGR reset sequence.
Variables ¶
This section is empty.
Functions ¶
func FG ¶
FG returns the complete escape sequence selecting a palette key's foreground colour at the given ladder rung. Mono callers must not colour at all — they have no business calling this.
func Palette ¶
Palette returns the palette as a copy: pixel key to hex color. The same keys map to ANSI colors when a terminal surface renders these grids, which is what keeps the two pipelines on one source. One rule does not live in the map: 'k' is panel-colored, and a surface with no panel behind the art must substitute TransparentEyeColor for it or the faces vanish.
func RenderHalfBlock ¶
RenderHalfBlock renders an asset as half-block terminal art: two pixel rows per text row, every cell painted (a transparent cell takes the panel colour — the terminal analogue of the SVG panel, which also keeps white pixels legible on light themes). The grid is padded to an even row count locally; the canonical grid is never mutated. Mono is not a valid mode here — use RenderShade.
func RenderSVG ¶
RenderSVG renders an asset to a complete SVG document on its natural canvas (the grid's aspect ratio plus padding). The panel variant draws a rounded dark panel behind the art and is legible on any background; the transparent variant is for dark surfaces only, and its metadata says so.
func RenderSVGSquare ¶
RenderSVGSquare renders an asset on a square canvas — the avatar/icon format — with the art centered. The side is the larger of the natural dimensions, so no art is ever cropped or scaled.
func RenderShade ¶
RenderShade renders an asset as the mono shade-block form: one glyph pair per pixel, no colour, never blank. This is the art the mono rung shows.
Types ¶
type Asset ¶
type Asset struct {
Name string // stable file stem for generated artifacts, e.g. "duckling"
Grid []string // pixel rows, top to bottom
// ApproximateGeometry marks a variant whose flag geometry is a spatial
// approximation rather than the true ICS specification. Only the
// full-size logo carries the true-geometry claim; the compact logo
// cannot (five stripes do not fit three rows) and must say so.
ApproximateGeometry bool
}
An Asset is one identity artwork as a pixel grid. Grid rows are strings of palette keys, one rune per cell; '.' is transparent. Every row of a grid has the same width.