Closed andrewfg closed 2 months ago
This pull request has been mentioned on openHAB Community. There might be relevant details there:
https://community.openhab.org/t/dimmer-and-color-item-to-same-channel/157241/27
Maybe some more background information, in case the sources given above are no longer available.... https://en.wikipedia.org/wiki/Correlated_color_temperature#Approximation
Unfortunately, the original publication is hidden behind a paywall...
@andrewfg is this still a draft or shall I have a look?
is this still a draft or shall I have a look?
I was keeping it as draft while writing the respective (first) addon PR .. in case there may be learnings from it. ..
do not like that huge lookup table
Honestly me neither. But as you say the function is difficult to invert.
Many thanks @holgerfriedrich :)
Do you think we should expose this to DSL rules (core repo org.openhab.core.model.script/src/org/openhab/core/model/script/actions/CoreUtil.java; docs repo, addons/actions.md) and to javascript?
@holgerfriedrich are any of the other public static methods of the ColorUtils class exposed? If so then I suggest to be simply consistent across all such methods.
Resolves #4369
This PR provides two new methods in the
ColorUtils
class as follows:kelvinToXY()
to convert a colour temperature in Kelvin to a point on the colour temperature locus in the CIE XY colour space, as described herexyToKelvin()
to convert a point on the colour temperature locus in the CIE XY colour space to a colour temperature in Kelvin, as described hereNote: the PR is created in ColorUtils in OH Core in case these conversions might be needed in other bindings.
Signed-off-by: AndrewFG software@whitebear.ch