palette: enlarge the region title into WCAG large class; repoint the grabbed envelope handle off hue

Corrects theme.h's large-text thresholds, names accent/secondary's real
binding limiter, and adds compositeOver so the loop-span fill's 2.25:1
under-floor pair is asserted rather than assumed.
This commit is contained in:
2026-07-31 14:07:01 -04:00
parent 91f71f92bd
commit a19d645a49
10 changed files with 221 additions and 82 deletions
+14 -10
View File
@@ -34,22 +34,20 @@ constexpr KitColor kDirHairline {74, 74, 74, 255}; // #4a4a4a — subtle ste
constexpr KitColor kDirTextPrimary{220, 220, 220, 255}; // #dcdcdc
constexpr KitColor kDirTextDim {168, 168, 168, 255}; // #a8a8a8 (lifted from #a0a0a0)
// Accent system: primary = pastel lime (the live/active/selected signal); secondary = deep
// teal, tertiary = pastel purple (CATEGORICAL distinctions — a KIND, never intensity).
// accent/hot is a brighter tint OF the primary for hover/live/drag. Secondary is the one
// accent off the pastel side: its binding limiter is the AA 4.5:1 text-on-fill pair (a bg/base
// label on a secondary fill), NOT the 3:1 indicator floor, so it cannot go darker than this.
// warn is reserved for byte-deleting states only.
// Accent system — roles and their categorical meaning are core/ui/CLAUDE.md's. Warning only:
// secondary CANNOT go darker. Its tightest pair is the velocity-curve trace on a HOVER-lightened
// bg/cell (3.03:1 against a 3:1 floor — the whole tree's thinnest margin), which no rest-surface
// check sees.
constexpr KitColor kDirAccentPrimary {176, 224, 152, 255}; // #B0E098 — pastel lime
constexpr KitColor kDirAccentSecondary{56, 168, 160, 255}; // #38A8A0 — deep teal
constexpr KitColor kDirAccentTertiary {194, 170, 232, 255}; // #C2AAE8 — pastel purple
constexpr KitColor kDirAccentHot {200, 236, 178, 255}; // #C8ECB2 — lighter pastel lime
constexpr KitColor kDirWarn {235, 120, 90, 255}; // #eb785a — destructive only
// The envelope trace over the waveform. Two neighbours pin it at once — the lime accent it
// crosses and bg/base behind it — which bound ANY single value to 3.07:1 against both; this is
// that optimum, with no room in either direction. No categorical accent can carry it: every
// one of them is light enough to fall under 2:1 against the lime.
// The envelope trace over the waveform. Warning only (the two-neighbour rule is
// core/ui/CLAUDE.md's): this value has NO room in either direction, and it is confined to the
// waveform band — inside the 20%-alpha loop-span fill it already sits under floor at 2.25:1,
// which no single value can fix.
constexpr KitColor kDirOverlayTrace{129, 106, 166, 255}; // #816AA6 — muted violet
// Spectral ramp: pastel lime (low) -> pastel teal (mid) -> pastel purple (high). The mid stop
@@ -160,6 +158,12 @@ KitColor spectralColor(double t) {
return mix(kDirSpectralMid, kDirSpectralHi, (t - 0.5) / 0.5);
}
KitColor compositeOver(const KitColor& over, const KitColor& under, double alpha) {
if (alpha < 0.0) alpha = 0.0;
if (alpha > 1.0) alpha = 1.0;
return mix(under, over, alpha);
}
double relativeLuminance(const KitColor& c) {
return 0.2126 * linearizeChannel(c.r) +
0.7152 * linearizeChannel(c.g) +