Skip to content

Conversation

@claycantrell
Copy link

Add Color Temperature Control via DDC

Summary

  • Adds a new Color Temperature slider to MonitorControl that adjusts display warmth/coolness via DDC commands
  • Implements color temperature by modulating Video Gain Red and Video Gain Blue DDC values
  • Adds UI toggle in App Menu preferences to show/hide the Color Temperature slider
  • Includes groundwork for per-display advanced settings for Color Temperature (DDC min/max overrides, curve, invert, remap)

How It Works

The color temperature control uses a simplified Kelvin-to-RGB approach:

  • Slider at 0 (Cool/~9300K): Red gain = 40, Blue gain = 70
  • Slider at 0.5 (Neutral/~6500K): Red gain = 50, Blue gain = 50
  • Slider at 1 (Warm/~2700K): Red gain = 60, Blue gain = 30

This creates an asymmetric adjustment where blue changes more dramatically than red, mimicking real color temperature behavior.

Files Changed

File Changes
MonitorControl/Enums/PrefKey.swift Added showColorTemperature preference key
MonitorControl/Support/MenuHandler.swift Added Color Temperature slider to menu (between Volume and Contrast)
MonitorControl/Support/SliderHandler.swift Implemented DDC write logic using videoGainRed/videoGainBlue
MonitorControl/View Controllers/Preferences/MenuslidersPrefsViewController.swift Added checkbox to toggle Color Temperature slider visibility
MonitorControl/UI/Base.lproj/Main.storyboard Added "Show color temperature slider" checkbox in App Menu preferences
MonitorControl/View Controllers/Preferences/DisplaysPrefsCellView.swift Added IBOutlets for per-display Color Temperature advanced settings
MonitorControl/View Controllers/Preferences/DisplaysPrefsViewController.swift Added enable/disable logic for Color Temperature controls
MonitorControl/Model/OtherDisplay.swift Fixed edge case where maxDDC ≤ minDDC would cause division issues
MonitorControl/UI/en.lproj/Localizable.strings Added "Color Temperature" localization string

Known Limitations

  • Per-display advanced settings UI (DDC min/max, curve, invert, remap) for Color Temperature not yet wired in storyboard - IBOutlets are ready but UI elements need to be added in Interface Builder
  • Color temperature uses Video Gain Red/Blue which may not be supported on all monitors

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.

1 participant