Skip to content

[minor] Add lift/gamma/gain colour wheels - #515

Merged
matt-edmondson merged 4 commits into
mainfrom
claude/project-thread-jgdwlt
Sep 29, 2026
Merged

matt-edmondson merged 4 commits into
mainfrom
claude/project-thread-jgdwlt

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Requested by Matt · project thread

Before: ktsu.ImGui.Widgets had no colour-grading control. A caller who wanted lift/gamma/gain wheels had to build them from XYPad and draw lists.

After: ImGuiWidgets.ColorWheel draws one grading wheel. It's a trackball ringed by the hues: the handle's angle is the hue, its distance from the centre is the strength, and a master luminance slider sits underneath. ImGuiWidgets.LiftGammaGain draws the usual three side by side, each with a caption. The widgets edit a ColorWheelValue(Hue, Strength, Master). ToRgbOffset() turns that into a per-channel offset, and applying the offset is left to the caller.

Behaviour:

  • Drags are relative, so pressing on the wheel grabs the handle where it already is and never jumps it.
  • Holding Shift gives quarter-speed fine adjustment. Pressing or releasing Shift mid-drag re-anchors the drag, so the handle doesn't jump.
  • Dragging past the rim pins the handle to the rim. Turning back inward responds straight away instead of waiting for the pointer to retrace the overshoot.
  • A double-click resets either the ball or the slider, each on its own. Resetting the ball keeps its hue.
  • Hues are laid out where a vectorscope puts them (red at 103°), so pushing the wheel moves a scope's trace the same way.
  • Hue colours come from ktsu.Semantics.Color (Hsv → Srgb) and are converted at the ImGui seam through ImGui.Color.

How: the drag rules and the geometry live in ColorWheelState, which has no ImGui dependency and is unit-tested on its own (ColorWheelStateTests). ColorWheelTests in ImGui.Widgets.UITests drives the widgets headlessly. The widgets demo has a new "Color wheels" section that grades a grey ramp, and it has its own demo UI test. The README and CLAUDE.md widget lists are updated.

Testing:

  • ImGui.Widgets.Tests: all 360 pass.
  • ImGui.Widgets.UITests: all 397 pass.
  • The new demo test passes. In the cloud checkout, 12 other demo tests fail because examples/ImGuiWidgetsDemo/ktsu.png was checked out as a Git LFS pointer. This change doesn't touch that file.

Closes #511

🤖 Generated with Claude Code

https://claude.ai/code/session_01HEAQ6ynUNXdf4LpFq8o8MX


Generated by Claude Code

ColorWheel is a colour-grading trackball: the angle of the handle is a hue,
its distance from the centre a strength, with a master slider underneath
for luminance. LiftGammaGain draws the usual three side by side. Drags are
relative, Shift is fine adjustment, and a double-click resets the ball or
the slider on its own. ColorWheelValue.ToRgbOffset turns a wheel into a
per-channel offset; applying it is left to the caller.

The drag rules live in ColorWheelState, which has no ImGui dependency and
is unit-tested on its own.

Closes #511

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HEAQ6ynUNXdf4LpFq8o8MX
@matt-edmondson matt-edmondson self-assigned this Sep 29, 2026
Comment thread ImGui.Widgets/ColorWheelValue.cs Fixed
Comment thread ImGui.Widgets/ColorWheel.cs Fixed
Comment thread ImGui.Widgets/ColorWheel.cs Fixed
Comment thread ImGui.Widgets/ColorWheel.cs Fixed
Keeps both the Waveform section from main and the colour wheels section from
this branch. The two extracted section classes pushed ImGuiWidgetsDemo over the
CA1506 coupling limit, so the extracted sections now go through SectionDemos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DpVgY5FC9FuBkBuBAzXZJ6
Keeps both sides: the spectrum analyzer from main and the colour wheels here.
SectionDemos now shows main's SignalDemos (waveform, spectrum) ahead of the
colour wheels and diff view sections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HEAQ6ynUNXdf4LpFq8o8MX
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Domain widgets Tier 2: add ColorWheels (lift/gamma/gain trackballs)

2 participants