Skip to content

feat(ascii): colored ASCII output (HTML + 24-bit ANSI)#12

Merged
mixflavor merged 1 commit into
mainfrom
feat/ascii-color
Jun 1, 2026
Merged

feat(ascii): colored ASCII output (HTML + 24-bit ANSI)#12
mixflavor merged 1 commit into
mainfrom
feat/ascii-color

Conversation

@mixflavor
Copy link
Copy Markdown
Contributor

Adds colour to the ASCII view so the mark can render like a coloured terminal mascot (e.g. the clikae startup banner).

What

  • imageToAscii samples per-cell RGB and gains color?: 'none' | 'html' | 'ansi':
    • none (default) — plain text, byte-identical to before (README easter-egg safe; existing tests unchanged).
    • html — each glyph wrapped in <span style="color:#rgb"> for the web preview (glyphs HTML-escaped).
    • ansi — 24-bit truecolor escapes for a terminal banner; emits a colour code only when it changes, resets each line with \x1b[0m, leaves blank rows empty.
  • Studio: Color toggle (coloured web preview via AsciiCompare's new asciiHtml prop) plus Copy ANSI / .ans download. Plain Copy / .txt behaviour is intentionally unchanged.

Tests

  • 6 new ascii tests (html spans, ansi escapes, blank-row, escaping, none == default). Full suite: 193/193 green. tsc clean on ascii.ts.

Dogfood

.anscat banner.ans in clikae's startup for a coloured banner.

🤖 Generated with Claude Code

imageToAscii now samples per-cell RGB and gains a `color` option:
'none' (default, byte-identical plain text — README-safe), 'html'
(per-glyph <span> for the web preview), and 'ansi' (24-bit truecolor
escapes for terminal banners, e.g. a CLI startup screen).

Studio gains a Color toggle (colored web preview) plus Copy ANSI /
.ans download; the plain Copy/.txt path is unchanged. ANSI emits a
color code only when it changes and resets each line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mixflavor mixflavor merged commit f51fdb3 into main Jun 1, 2026
1 check passed
@mixflavor mixflavor deleted the feat/ascii-color branch June 1, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants