feat(app): add Catppuccin Mocha, Nord, and Dracula theme presets - #58
Merged
Conversation
Three community themes ported verbatim from their official terminal specs: - **Catppuccin Mocha** — the most-starred Catppuccin flavour. Background base #1e1e2e, foreground text #cdd6f4, cursor rosewater #f5e0dc. ANSI ring from the official catppuccin/catppuccin palette. Normal and bright chromatic pairs are identical per upstream spec (dE-OK 0.000 — a known community-palette property, noted in ThemeValues.swift). - **Nord** — the Arctic, north-bluish palette by Arctic Ice Studio. Background nord0 #2e3440, foreground nord4 #d8dee9. Frost and Aurora colour groups fill the ANSI ring. Most chromatic normal/bright pairs are identical per upstream spec. One known gap (PINNED): the keyword syntax role (nord9 #81A1C1) measures APCA Lc 43.6 on nord0, 1.4 points below the universal Lc 45 floor — verbatim ports are not edited, so this is pinned at ≥ 40 in the gate rather than silently fixed. - **Dracula** — the popular dark theme by Zeno Rocha. Background #282a36, foreground #f8f8f2, selection #44475a. Provides distinct bright variants for most ANSI slots (better ring separation than the other two ports). Gate results: - check-theme-contrast.sh: ALL-OK 474 assertions passed (was 345) - check-file-size.sh: all 116 files under 350 LOC - swift build: Build complete Files changed: - ThemeValues.swift: three new ThemePalette statics + added to .all - Theme.swift: three Theme bridge statics - StarterConfig.swift: updated preset list in comment - check-theme-contrast-registry.swift: expectedNames expanded - check-theme-contrast-syntax.swift: Nord keyword gap pinned
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.
What this adds
Three community themes ported verbatim from their official terminal specifications:
"catppuccin-mocha"#1e1e2e#cdd6f4"nord"#2e3440#d8dee9"dracula"#282a36#f8f8f2All three are MIT-licensed community palettes. Each is a verbatim port — the upstream hex values are transcribed exactly, including their known weaknesses, because a preset's job is to be the thing it claims to be.
Usage
{ "theme": { "preset": "catppuccin-mocha" } } { "theme": { "preset": "nord" } } { "theme": { "preset": "dracula" } }Contrast gate results
bash Scripts/check-theme-contrast.sh— ALL-OK: 474 assertions passed (up from 345 before this PR).The 129 new assertions cover:
named("catppuccin-mocha"),named("nord"),named("dracula")and their hyphen-stripped / underscored / uppercased variantsDocumented gaps (pinned, not silently "fixed")
Catppuccin Mocha and Nord: all eight chromatic normal/bright ANSI pairs are identical (dE-OK 0.000). This is a known property of the upstream palettes — the same trait Tokyo Night (already shipped) exhibits. Documented in
ThemeValues.swift'sumberdoc comment as the measured failure mode. The gate does not hold community ports to Umber's ring-separation floor (only Umber is designed to that spec).Nord keyword color (PINNED):
nord9(#81a1c1) measures APCA Lc 43.6 onnord0(#2e3440) — 1.4 points below the Lc 45 floor for any-size readable text. This affects the keyword syntax role in the file editor. A pinned assertion incheck-theme-contrast-syntax.swiftholds it to ≥ 40, so silent regression to truly unreadable territory is still caught. The correct fix would be Nord upstream choosing a slightly brighter blue; substituting a colour the upstream palette doesn't ship would make this not-Nord.Nord and Catppuccin Mocha comment colors: ANSI 8 is below Lc 45. The existing
commentColour()fallback inSyntaxPalette.swiftapplies and composites toward the foreground at 0.72 alpha, lifting the comment to a readable Lc. This is the same mechanism that already handles Tokyo Night and afk-dark.Files changed
Sources/Umber/ThemeValues.swift— three newThemePalettestatics, added to.all(333 LOC, ceiling 350)Sources/Umber/Theme.swift— threeThemebridge staticsSources/Umber/StarterConfig.swift— updated preset list in the commented config templateScripts/check-theme-contrast-registry.swift—expectedNamesexpanded to include the three new presetsScripts/check-theme-contrast-syntax.swift— Nord keyword gap pinned (same pattern as classic-repaired's comment gap)Verification