crabidy/cbd-tui
Test User d5b35a4da2 cbd-tui: shade the spectrum bars and hold their peaks
Modelled on BeSpec's LED mode. Bars are now shaded by height rather than
drawn in one flat color, and a peak-hold marker rides above each column.

Shading is a function of the row alone, so it stays cheap: the color is
computed once per row and the row's cells still coalesce into a couple of
spans. `gradient_color` ramps the configured base from 55% brightness at
the floor to 30% toward white at the top, so a loud bar reads as hot and
not merely tall. Only an `Rgb` base can be interpolated -- a color name or
a palette index is a reference into the terminal's own theme, whose RGB
value is not ours to know -- so those render flat, whatever
`spectrum_gradient` says.

The peaks are per-bin state advanced in `update_spectrum`: a bin at or
above its peak raises it at once, otherwise the peak falls 0.03 a frame,
about 1.7s from full scale at the server's 20 fps. The server keeps
streaming zeroed frames while the audio is idle, so the markers fall away
on pause instead of freezing on screen. A marker is drawn only in a row
the bar does not reach: a cell holds one glyph, so one inside the bar's
own top cell would eat the bar to repeat what its top edge already shows.

Config gains `spectrum_gradient` (default true) and `spectrum_peak_color`
(default the primary blue, `"none"`/`"off"` to draw none), resolved with
`spectrum_color` into one `SpectrumStyle` in place of the old
`set_spectrum_color`. Existing config files take the defaults.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 13:08:43 +02:00
..
src cbd-tui: shade the spectrum bars and hold their peaks 2026-07-27 13:08:43 +02:00
Cargo.lock Add cbd-tui 2023-05-17 19:08:48 +02:00
Cargo.toml build: put every provider, opus, and the spectrum behind cargo features 2026-07-25 03:15:32 +02:00
build.rs Implement the comprehensive CLI (stage 5) 2026-07-22 12:13:51 +02:00
schema.graphql Add cbd-tui 2023-05-17 19:08:48 +02:00