NiklasReiche / ad-spotify-mood-lights-sync

AppDaemon app that synchronizes rgb lights to the mood of the currently playing spotify song in Home Assistant.
MIT License
35 stars 5 forks source link

Switch to HSV space interpolation #10

Closed NiklasReiche closed 7 months ago

NiklasReiche commented 1 year ago

Problem

The current color interpolation is done in RGB space, which produces unexpected interpolation results for the human eye (grey intermediate values). An unintuitive post-processing step is necessary to adapt the produced color and remove gray elements. The resulting values produce inconsistent brightness and saturation results when converted to HSV space (#9).

Possible Solution

Switching to an HSV space interpolation could produce more visually consistent results and make the calculation more comprehensible. Brightness and saturation interpolation should be trivial. Hue interpolation may require additional steps.

NiklasReiche commented 1 year ago

Old interpolation

out_old

New RGB interpolation (higher local influence)

out

New HSV interpolation

out