Expand description
Numeric helpers: “nice” tick generation and number formatting.
Functions§
- darken
- Darken a color toward black by
amount(0..=1); used for unfilled tracks. - format_
compact - Compact human format:
1.5k,2.3M,4B. - format_
tick - Format a tick value with just enough decimals for the given step.
- mix
- Mix
atowardbbyt(0 =a, 1 =b); the result is alwaysRgb. - nice_
bounds - Expand
[min, max]outward to the nearest “nice” tick multiples. - nice_
step - Round a raw step up to a “nice” value (1, 2, 5 × 10ⁿ).
- nice_
ticks - Generate roughly
countnicely spaced tick values inside[min, max]. - tick_
step - Step between the first two ticks (or 1.0).
- to_rgb
- Approximate RGB of a terminal color (named colors use common xterm values).