Repository navigation
Themes: part colours, palettes, genre looks and striped rows - #32
Merged
Merged
Conversation
LayoutTheme colours borders, titles, headings, labels, separators, bullets, guides, the header rule and gauge parts. ThemePalette names ten colours by role and maps them onto those parts; palettes come from presets, base16 schemes, JSON, or one seed colour with a harmony, each accent moved in lightness until it meets a WCAG contrast ratio. Every colour keeps a standard colour, picked by hue, for sixteen-colour clients. Themed.Fallback puts a game's default under a reader's theme. HTML writes the colours as --ms-* custom properties that LayoutCss reads. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM
|
Warning Review paused — included plan limit reachedKeep your review moving with free on-demand reviews.
On-demand reviews are free for the next 3 days.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Promotion and pricing detailsOn-demand reviews are free for the next 3 days. After that, they cost $0.25 per reviewed file. Review limit detailsOr wait 12 minutes for your next included review. Limit details: You’ve used the included review currently available. Your 78 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (23)
Comment |
A standard colour looks however the reader's client makes it, so a ratio against the VGA value says nothing about what the reader sees. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM
HarryCordewener
marked this pull request as ready for review
October 7, 2026 06:00
|
Add Carrot credits or activate Agent usage billing to use Autopilot |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Grave · project thread
Before: a
LayoutThemeset only characters (border style, guides, bullet, gauge pieces). The only way to colour a whole layout wasColoredorShaded, which paint every part the same way.After: a theme colours each part of a layout on its own, can bring its own shapes (border, title ornaments, bullet, gauge), and can stripe every second row of a table or field list. A palette gives a full set of colours in one step: a preset, one of nine genre themes, any base16 scheme, JSON, or one seed colour.
How:
LayoutThemegainsBorderColor,TitleColor,HeadingColor,LabelColor,SeparatorColor,BulletColor,GuideColor,HeaderRuleColor,GaugeFilledColor,GaugeEmptyColorandStripeColor, each anIMarkup. Each block paints its own pieces; colour a piece sets itself still wins. The codec keeps them through the serializer and relayout.ThemePalette. Eleven roles (background, surface, foreground, primary, secondary, tertiary, muted, success, warning, error, info), mapped onto the parts byToTheme(paint), which asks for each colour as text, bold or background (ThemePaint).AnsiTheme.ToLayoutTheme()paints in ANSI.Generate(seed, harmony, mode, contrast). Accent hues from the seed by harmony; each accent's OKLCH lightness is moved until its WCAG contrast reaches 3:1 for lines and 4.5:1 for text (7:1 atcontrast1). A generated palette keeps its seed, soInModemakes it again for a light or dark background, and{"preset":"fantasy","mode":"light"}does the same from JSON.ThemeLook. A look sets a border preset, ornaments either side of a title, the tree guide, bullet, gauge pieces, field separator and header rule (lookin JSON).ThemePalette.Genreshas one theme per MSSP genre: adult, fantasy, historical, horror, modern, mystery, romance, science-fiction, spiritual. An ASCII-only reader gets the ASCII form of each piece.Table.StripedandFields.Stripedlay every second row, all its lines and the full width, onStripeColor; a cell's own background wins. HTML:ms-stripedand--ms-stripe.ColorMath.StandardSlot), sent asStandardForeground.ThemePalette.Terminaluses standard colours only.Themed.Fallback/.ThemedUnder(). A theme that fills in only what the surrounding one leaves unset, so a game's default sits under a reader's theme.--ms-border,--ms-title, ... (-defaultfor a fallback), whichLayoutCssreads.IColorMarkup.Backgroundreports a layer's background.ColorMath. Contrast,WithContrast, OKLCH conversion, hue rotation, hex parsing.Docs: "Themes and palettes" and "Striped rows" in
docs/layout.md; changelog entries. Tests:ThemeTests(contrast in both modes for every harmony, base16, JSON round trips and errors, genre looks in Unicode and ASCII, stripes, mode regeneration, ANSI at full and 16-colour depth, fallback order, serializer and relayout, HTML). Full suite passes (964 tests), including after merging main.Design notes are in the project's
markup-themes/plan.md.🤖 Generated with Claude Code
https://claude.ai/code/session_014FuCWyo4QX6dza8MxQQoZM