Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSL] Expose ColorUtil methods to DSL rules #4410

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down