diff --git a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/CoreUtil.java b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/CoreUtil.java index 50fb23fed5d..f6fc5eb9416 100644 --- a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/CoreUtil.java +++ b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/CoreUtil.java @@ -70,4 +70,16 @@ public static HSBType xyToHsb(double[] xy, double[] gamutR, double[] gamutG, dou Gamut gamut = new Gamut(gamutR, gamutG, gamutB); return ColorUtil.xyToHsb(xy, gamut); } + + public static double xyToDuv(double[] xy) throws IllegalArgumentException { + return ColorUtil.xyToDuv(xy); + } + + public static double[] kelvinToXY(double kelvin) throws IndexOutOfBoundsException { + return ColorUtil.kelvinToXY(kelvin); + } + + public static double xyToKelvin(double[] xy) throws IllegalArgumentException { + return ColorUtil.xyToKelvin(xy); + } } diff --git a/bundles/org.openhab.core/src/main/java/org/openhab/core/util/ColorUtil.java b/bundles/org.openhab.core/src/main/java/org/openhab/core/util/ColorUtil.java index d7b1499e3c4..a611ece5767 100644 --- a/bundles/org.openhab.core/src/main/java/org/openhab/core/util/ColorUtil.java +++ b/bundles/org.openhab.core/src/main/java/org/openhab/core/util/ColorUtil.java @@ -1202,9 +1202,9 @@ public static double[] kelvinToXY(double kelvin) throws IndexOutOfBoundsExceptio * * @param xy an array with the CIE colour XY values to be converted * @return the colour temperature in K - * @throws IndexOutOfBoundsException if the wrong number of arguments is provided + * @throws IllegalArgumentException if the wrong number of arguments is provided */ - public static double xyToKelvin(double[] xy) { + public static double xyToKelvin(double[] xy) throws IllegalArgumentException { if (xy.length != 2) { throw new IllegalArgumentException("xyToKelvin() requires 2 arguments"); }