---
title: "There are many themes, but this one is yours"
description: "Pi's new default system theme queries the terminal for its foreground, background and 16 ANSI colors, keeps their hue and chroma, and recomputes lightness so that around 60 UI color roles meet per-surface contrast rules."
url: "https://swe.quest/articles/there-are-many-themes-but-this-one-is-yours-54d3fb5afa0c1ab8"
canonical: "https://earendil.com/posts/system-theme/"
source: "Earendil"
published: "2026-10-09"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 12
tags: ["accessibility","developer-tools","algorithms"]
---

# There are many themes, but this one is yours

A post on [Earendil](https://swe.quest/sources/earendil.md), published 2026-10-09, 12 min read, Deep dive. Original: [https://earendil.com/posts/system-theme/](https://earendil.com/posts/system-theme/)

## Summary

Pi's new default system theme queries the terminal for its foreground, background and 16 ANSI colors, keeps their hue and chroma, and recomputes lightness so that around 60 UI color roles meet per-surface contrast rules. Because ANSI palettes have no contrast guarantees (an analysis of 460+ Ghostty themes shows bright variants and bright black often fail WCAG minimums), Pi solves lightness using fifth-degree polynomials fitted by a coding agent to a reversed perceptual contrast algorithm, taking the strictest rule per color. Colors are built in OKHSL with a saturation falloff toward black and white, plus a chroma cap so a moved color is never more vivid than the original, a fix prompted by Catppuccin Frappé looking oversaturated.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)

## Prerequisites

- RGB color basics
- WCAG contrast ratio
- terminal ANSI colors

## Keywords

Pi, OKLCH, OKHSL, WCAG, ANSI X3.64, Ghostty, Catppuccin, ECMA-48

## Related posts

- [How to have the browser pick a contrasting color in CSS](https://swe.quest/articles/how-to-have-the-browser-pick-a-contrasting-color-in-css-9cfb1d29a0334ca0.md): WebKit · 2025-05-13 · Medium · 12 min read · CSS, Accessibility, Browsers, Frontend
  CSS \`contrast-color()\` takes one color and returns black or white, whichever contrasts more, so a single variable like \`--button-color\` can drive both background and text, including hover states built with relative color syntax.
- [Unlocking inclusive design: how Primer’s color system is making GitHub.com more inclusive](https://swe.quest/articles/unlocking-inclusive-design-how-primer-s-color-system-is-making-github-com-more-438d95888d234cb3.md): GitHub Engineering · 2023-05-11 · Medium · 6 min read · Accessibility, Design systems, CI/CD, Frontend
  GitHub's Primer design system fixed hundreds of color contrast violations across light and dark modes and all themes by changing its foundational color tokens (Primer Primitives) rather than individual components.
- [Customizing Color Fonts on the Web](https://swe.quest/articles/customizing-color-fonts-on-the-web-74940ba780f012e8.md): WebKit · 2022-05-25 · Medium · 7 min read · CSS, Browsers, Frontend
  WebKit (Safari 15.4+) supports the CSS \`@font-palette-values\` at-rule, which lets authors select a color font's predefined CPAL palettes by index and override individual palette colors, then apply them with the \`font-palette\` property.
- [Add wide gamut P3 and alpha transparency to your color picker in HTML](https://swe.quest/articles/add-wide-gamut-p3-and-alpha-transparency-to-your-color-picker-in-html-2bf169620936554b.md): WebKit · 2025-05-07 · Medium · 4 min read · Browsers, Frontend, CSS
  \`\<input type="color"\>\` now supports two new optional attributes, \`alpha\` and \`colorspace\`, added to the HTML standard with WHATWG and first shipped in Safari 18.4.
- [Introducing Adaptive Dark Mode](https://swe.quest/articles/introducing-adaptive-dark-mode-b5085c9f9c7b77a6.md): WebKit · 2026-11-03 · Medium · 5 min read · Browsers, CSS, Accessibility, Privacy
  Safari 27.3 beta adds Adaptive Dark Mode, which automatically darkens light websites that don't declare dark mode support via color-scheme.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
