palette: give the spectral mid and the envelope trace their own roles

Decouples the keyboard strip's mid stop from accent/secondary, which the
deep-teal darkening had inverted. Adds overlay/trace (#816AA6), the first
value to clear 3:1 against the waveform. Replaces the frozen-premise test.
This commit is contained in:
2026-07-31 13:27:20 -04:00
parent 04e4f875af
commit 91f71f92bd
6 changed files with 153 additions and 88 deletions
+23 -15
View File
@@ -34,24 +34,31 @@ 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)
// Three-accent pastel system: primary = pastel lime (the live/active/selected signal);
// secondary = pastel teal, tertiary = pastel purple (CATEGORICAL distinctions — a KIND, never
// intensity). accent/hot is a brighter tint OF the primary for hover/live/drag. On bg/cell the
// pastels clear the 3:1 indicator floor comfortably at these values (primary ~7.6, secondary
// ~6.8, tertiary ~5.5), so no per-hue nudge was needed. warn is reserved for byte-deleting
// states only.
// 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.
constexpr KitColor kDirAccentPrimary {176, 224, 152, 255}; // #B0E098 — pastel lime
constexpr KitColor kDirAccentSecondary{132, 214, 208, 255}; // #84D6D0 — pastel teal
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
// Spectral ramp: pastel lime (low) -> pastel teal (mid) -> pastel purple (high). Endpoints and
// midpoint ARE the three accent constants (single source), so the keyboard strip reads as an
// extension of the accent system.
constexpr KitColor kDirSpectralLo = kDirAccentPrimary;
constexpr KitColor kDirSpectralMid = kDirAccentSecondary;
constexpr KitColor kDirSpectralHi = kDirAccentTertiary;
// 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.
constexpr KitColor kDirOverlayTrace{129, 106, 166, 255}; // #816AA6 — muted violet
// Spectral ramp: pastel lime (low) -> pastel teal (mid) -> pastel purple (high). The mid stop
// is its OWN value rather than the secondary accent it once aliased — the ramp is a luminance
// progression while the accents are categorical roles, and darkening secondary for a
// categorical reason inverted lo->mid->hi. Do not re-alias it.
constexpr KitColor kDirSpectralLo = kDirAccentPrimary;
constexpr KitColor kDirSpectralMid{132, 214, 208, 255}; // #84D6D0 — pastel teal
constexpr KitColor kDirSpectralHi = kDirAccentTertiary;
// --- state transform helpers -------------------------------------------------
@@ -108,6 +115,7 @@ KitColor roleColor(Role role) {
case Role::AccentSecondary: return kDirAccentSecondary;
case Role::AccentTertiary: return kDirAccentTertiary;
case Role::AccentHot: return kDirAccentHot;
case Role::OverlayTrace: return kDirOverlayTrace;
case Role::Warn: return kDirWarn;
}
return kDirBgBase; // unreachable; keeps non-void control flow total
@@ -144,8 +152,8 @@ KitColor roleColorState(Role role, InteractionState state) {
KitColor spectralColor(double t) {
if (t < 0.0) t = 0.0;
if (t > 1.0) t = 1.0;
// Interpolate each half separately so the midpoint IS the secondary accent (a single
// Lo->Hi lerp would skip it and drift the ramp off the accent family).
// Interpolate each half separately so the mid stop is actually hit — a single Lo->Hi lerp
// would skip it and drift the ramp off the pastel arc.
if (t <= 0.5) {
return mix(kDirSpectralLo, kDirSpectralMid, t / 0.5);
}