Raxol.UI.Theming.SalienceTheme (Raxol v2.6.1)

View Source

Builds a Raxol.UI.Theming.Theme from salience-tier seeds solved against the terminal's actual background.

Colors are expressed as (hue, chroma, tier) seeds — hue carries identity, tier carries importance — and Raxol.UI.Theming.Salience solves the lightness of every color so each tier reads perceptually level on the detected ground. Works on dark and light terminals from one seed table.

Ground detection is optional: when Raxol.Terminal.Driver.BackgroundQuery is loaded and has a reply, its OSC 11 background reading is used; otherwise (including on this branch, which does not depend on that module) it falls back to Salience.reference_ground/0.

Summary

Functions

Builds a Theme with every color solved against the ground.

Detected ground lightness: OKLCH L of the OSC 11-reported terminal background, or Salience.reference_ground/0 when detection is unavailable.

The default semantic seed table.

Functions

build(opts \\ [])

@spec build(keyword()) :: Raxol.UI.Theming.Theme.t()

Builds a Theme with every color solved against the ground.

Options

  • :ground - ground lightness override (default: detect_ground/0)
  • :seeds - seed table override (default: seeds/0)
  • :id / :name - theme identity (default :salience)

detect_ground()

@spec detect_ground() :: float()

Detected ground lightness: OKLCH L of the OSC 11-reported terminal background, or Salience.reference_ground/0 when detection is unavailable.

seeds()

@spec seeds() :: [map()]

The default semantic seed table.