-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Changing color temperature linearly makes low-temp changes (e.g. 2000K-3000K) much more pronounced than high-temp changes (e.g. 8000K-9000K). Interpolating temperatures in the "inverse space" solves this, and is equivalent to using mireds, which are supposed to be perceptually uniform:
https://en.wikipedia.org/wiki/Mired
For reference, here is a Desmos plot showcasing the difference:
https://www.desmos.com/calculator/db2e0zo2ls
Another small benefit is that each update will be the same visual difference, so no "wasted" updates at high temps (ignoring any curves on top). Hypothetically, the update_interval could be completely removed and calculated from transition speed and Just Noticeable Difference of mireds. According to this article, the JND for human eye is about 5.5 mireds:
https://www.mdpi.com/2071-1050/16/11/4838
The more I think about it, it might be nice to just use mireds internally, but maybe that's way too overkill.
I tried to make a small PR for the interpolation change (#43), but I'm new to Rust, so apologies if I missed something obvious. And no worries if it's not something you want. One con is that it makes the transitions lower-temp on average, slightly changing what the users expect.
And thanks for sunsetr, I love it :)