Skip to content

Add Chroma: shared color roles, gradients and capability fallback - #220

Open
raiseCatError wants to merge 1 commit into
feature/170-accessibility-baselinefrom
feature/171-chroma
Open

raiseCatError wants to merge 1 commit into
feature/170-accessibility-baselinefrom
feature/171-chroma

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Implements #171.

Stacked on #219 (feature/170-accessibility-baseline), on #218, #217 and #203. Merge order: #203, #217, #218, #219, then this PR.

What changed

  • src/chroma/chroma.ts: color references in three separate categories: status (success/failure/working), theme (primary, accent, selection and so on) and identity (a thing's own color, such as a language). statusMeaning() returns a value only for status colors, so an identity color can never read as success or failure. Also solid colors, linear and multi-stop gradients, easing curves (linear, ease-in, ease-out, ease-in-out), luminance and gradientText.
  • src/chroma/escape.ts: one place that turns a color into an escape sequence for truecolor, 256-color or no color. ui/palette foreground()/background() now go through it, so every existing panel follows the capability level.
  • NMSH_COLOR=256 selects the 256-color mapping; automatic detection is not added.
  • Consumers: the shimmer uses Chroma's mixing, and Settings status tones use the status and theme roles.
  • BRAND_LAVENDER (#A67CF3) is exported as a default, and nothing depends on it.

Boundaries

Verification

tests/chroma.test.ts; full suite 642/642, typecheck, build and git diff --check clean.

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