Skip to content

Commit

Permalink
Changes in case of change core library
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Müller <marco@ms-mueller.ch>
  • Loading branch information
genesis81 committed Nov 8, 2023
1 parent 04e2051 commit ee6fded
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ private static Type handleDpt10(String value) throws ParseException {

if (rString != null && gString != null && bString != null && wString != null
&& HSBType.class.equals(preferredType)) {
double r = coerceToRange(Double.parseDouble(rString.replace(",", ".")) * 2.55, 0, 255);
double g = coerceToRange(Double.parseDouble(gString.replace(",", ".")) * 2.55, 0, 255);
double b = coerceToRange(Double.parseDouble(bString.replace(",", ".")) * 2.55, 0, 255);
double w = coerceToRange(Double.parseDouble(wString.replace(",", ".")) * 2.55, 0, 255);
int r = coerceToRange((int) Math.round(Double.parseDouble(rString.replace(",", ".")) * 2.55), 0, 255);
int g = coerceToRange((int) Math.round(Double.parseDouble(gString.replace(",", ".")) * 2.55), 0, 255);
int b = coerceToRange((int) Math.round(Double.parseDouble(bString.replace(",", ".")) * 2.55), 0, 255);
int w = coerceToRange((int) Math.round(Double.parseDouble(wString.replace(",", ".")) * 2.55), 0, 255);

return ColorUtil.rgbwTohsb(r, g, b, w);
return ColorUtil.rgbToHsb(new int[] { r, g, b, w });
} else if (wString != null && PercentType.class.equals(preferredType)) {
// does support PercentType and w valid -> PercentType
BigDecimal w = new BigDecimal(wString.replace(",", "."));
Expand Down

0 comments on commit ee6fded

Please sign in to comment.