Expand description
Theme-aware 256-color helpers.
The terminal 256-color palette can be “non-harmonious” on light themes when palette semantics are intentionally flipped for compatibility. In that mode, cube/gray indices need to be reflected to keep visual intent stable.
Functions§
- adjust_
index_ for_ theme - Adjust an ANSI256 index based on a light/dark theme hint.
- rgb_
to_ ansi256_ for_ theme - Convert RGB to ANSI256 and apply theme-aware palette adjustment.
- set_
harmonious_ runtime_ hint - Store a runtime harmony hint.