Skip to content

feat(app): add Catppuccin Mocha, Nord, and Dracula theme presets - #58

Merged
griffinwork40 merged 1 commit into
mainfrom
afk/community-themes
Aug 25, 2026
Merged

feat(app): add Catppuccin Mocha, Nord, and Dracula theme presets#58
griffinwork40 merged 1 commit into
mainfrom
afk/community-themes

Conversation

@griffinwork40

Copy link
Copy Markdown
Owner

What this adds

Three community themes ported verbatim from their official terminal specifications:

Preset Config string Background Foreground Source
Catppuccin Mocha "catppuccin-mocha" #1e1e2e #cdd6f4 catppuccin/catppuccin
Nord "nord" #2e3440 #d8dee9 nordtheme.com
Dracula "dracula" #282a36 #f8f8f2 draculatheme.com

All 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.shALL-OK: 474 assertions passed (up from 345 before this PR).

The 129 new assertions cover:

  • Hex parseability for all three palettes (background, foreground, cursor, selection, 16 ANSI slots each)
  • Config-string round-trip: named("catppuccin-mocha"), named("nord"), named("dracula") and their hyphen-stripped / underscored / uppercased variants
  • Tab-strip chrome legibility for all three palettes (rail contrast, active/inactive label Lc, active/inactive separation)
  • Syntax role legibility for all three palettes (five roles × three palettes)
  • Selection pairing readability

Documented 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's umber doc 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 on nord0 (#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 in check-theme-contrast-syntax.swift holds 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 in SyntaxPalette.swift applies 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 new ThemePalette statics, added to .all (333 LOC, ceiling 350)
  • Sources/Umber/Theme.swift — three Theme bridge statics
  • Sources/Umber/StarterConfig.swift — updated preset list in the commented config template
  • Scripts/check-theme-contrast-registry.swiftexpectedNames expanded to include the three new presets
  • Scripts/check-theme-contrast-syntax.swift — Nord keyword gap pinned (same pattern as classic-repaired's comment gap)

Verification

bash Scripts/check-theme-contrast.sh   # ALL-OK  474 assertions passed
bash Scripts/check-file-size.sh        # all 116 files under 350 LOC
swift build                             # Build complete

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
@griffinwork40
griffinwork40 merged commit fc3f545 into main Aug 25, 2026
1 check failed
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.

1 participant