Skip to content

Commit

Permalink
rectacoring
Browse files Browse the repository at this point in the history
Signed-off-by: AndrewFG <[email protected]>
  • Loading branch information
andrewfg committed Nov 27, 2024
1 parent 5214ab0 commit d5daa92
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ private void sendKelvin(int kelvin) throws IOException {
* @return the HSB presentation state
*/
private static HSBType buildHSB(Color normalColor, int brightness, boolean on) {
int[] normalizedRGB = { normalColor.r(), normalColor.g(), normalColor.b() };
HSBType normalizedHSB = ColorUtil.rgbToHsb(normalizedRGB);
PercentType brightnessParam = on ? new PercentType(brightness) : PercentType.ZERO;
return new HSBType(normalizedHSB.getHue(), normalizedHSB.getSaturation(), brightnessParam);
int[] normalRGB = { normalColor.r(), normalColor.g(), normalColor.b() };
HSBType normalHSB = ColorUtil.rgbToHsb(normalRGB);
PercentType brightnessPercent = on ? new PercentType(brightness) : PercentType.ZERO;
return new HSBType(normalHSB.getHue(), normalHSB.getSaturation(), brightnessPercent);
}

void handleIncomingStatus(String response) {
Expand Down

0 comments on commit d5daa92

Please sign in to comment.