Преглед изворни кода

Round 170a2: lit step fallback is the accent

Ka1-S пре 1 месец
родитељ
комит
6beeb00c8e
4 измењених фајлова са 19 додато и 4 уклоњено
  1. 15 0
      docs/analise/REA_rodada170a.md
  2. 2 2
      src/core/ThemePalette.cpp
  3. 1 1
      src/core/ThemePalette.h
  4. 1 1
      tests/Rack170aTests.inc

+ 15 - 0
docs/analise/REA_rodada170a.md

@@ -107,3 +107,18 @@ scan code (in.ps1 ctrlkey2); without it no Ctrl shortcut reaches LYNX (Ctrl+Z ne
 
 - done: §1–§5, note names, FL session (shots in C:\Users\kauan\lynx-test\r170a), tests tests/Rack170aTests.inc.
 - done: LYNX Windows screenshots. In progress: merge train.
+
+## Round 170a2 — beat-group tint and lit-step colours (coordinator + user, 2026-11-05)
+
+- Problem (LYNX shot N7): at 28 % accent the empty steps of groups 2 / 4 were a mid red, the hue of a lit step — they
+  read as active steps. Now `stepOffAlt = mix (mix (stepOff, textPrimary, stepGroupLift = 0.08), accent,
+  stepGroupTint = 0.12)`: a dull reddish grey (0x4f3c42 on the default theme; a pinkish grey on a light theme), as
+  FL's alternate groups (r170a f2: a dull reddish grey, much darker than a lit step). Tests: low saturation (channel
+  spread <= 30), far from the lit step, still >= 45 apart from the plain group.
+- Lit steps in the channel's colour (user request). [SHOT r170a2 FL 2026, one session, channels given random colours,
+  /mnt/e/lynx-work/r170a/tint/fl_*.png] FL's lit steps stay white / pink whatever the channel colour; the Channel rack
+  options menu's "Colorful channel controls" (TFruityLoopsMainForm ColorfulChannelControlsMenu, off by default,
+  restored off after the test) only colours each channel's mixer-insert box, not the steps. FL has no option for
+  coloured steps, so LYNX adds its own: Settings › General "Steps use channel colour", on by default (settings key
+  rackStepsChannelColour). `themes::litStepColour` lifts the colour (to white on a dark theme, black on a light one)
+  until its WCAG contrast is >= 2.6 against both empty-step greys; a channel without a colour keeps the theme's lit step.

+ 2 - 2
src/core/ThemePalette.cpp

@@ -121,7 +121,7 @@ Palette derivePalette (std::uint32_t accentIn, std::uint32_t backgroundIn)
 std::uint32_t litStepColour (std::uint32_t channelColour, const Palette& palette)
 {
     if ((channelColour & 0x00ffffffu) == 0)
-        return palette.stepOn;
+        return palette.accent;
     const auto colour = channelColour | 0xff000000u;
     const auto lightTheme = relativeLuminance (palette.stepOff) > 0.4;
     const auto towards = lightTheme ? 0xff000000u : 0xffffffffu;
@@ -131,7 +131,7 @@ std::uint32_t litStepColour (std::uint32_t channelColour, const Palette& palette
         if (contrastRatio (lit, palette.stepOff) >= minLitStepContrast && contrastRatio (lit, palette.stepOffAlt) >= minLitStepContrast)
             return lit;
     }
-    return palette.stepOn;
+    return palette.accent;
 }
 
 const Palette& defaultPalette()

+ 1 - 1
src/core/ThemePalette.h

@@ -48,7 +48,7 @@ constexpr double stepGroupTint = 0.12;
 
 // A lit Channel Rack step in its channel's colour (LYNX, round 170a2; FL keeps its steps white / pink): the colour
 // lifted (towards white on a dark theme, black on a light one) until it stands clear of both empty-step greys
-// (WCAG contrast >= minLitStepContrast against stepOff and stepOffAlt). 0 (no colour) = the palette's stepOn.
+// (WCAG contrast >= minLitStepContrast against stepOff and stepOffAlt). 0 (no colour) = the palette's lit step, the accent.
 constexpr double minLitStepContrast = 2.6;
 std::uint32_t litStepColour (std::uint32_t channelColour, const Palette& palette);
 

+ 1 - 1
tests/Rack170aTests.inc

@@ -183,7 +183,7 @@ TEST (rack170a2_lit_steps_in_the_channel_colour)
     for (const auto bg : { 0xff1c1e23u, 0xfff2f3f5u })
     {
         const auto p = derivePalette (0xffe5383bu, bg);
-        CHECK (litStepColour (0, p) == p.stepOn); // no channel colour: the theme's lit step
+        CHECK (litStepColour (0, p) == p.accent); // no channel colour: the theme's lit step (the accent)
         for (const auto colour : { 0xffe5383bu, 0xff2fbf71u, 0xff3d8bfdu, 0xff202020u, 0xffeeeeeeu, 0xff5c1f24u, 0xfff0a020u })
         {
             const auto lit = litStepColour (colour, p);