From 1cf7fd545e23e692ef3baec10289f3e1d0d25a33 Mon Sep 17 00:00:00 2001 From: brindosch Date: Tue, 12 Jul 2016 23:33:30 +0200 Subject: [PATCH] Bugfix sync with hyperion repo (#110) * #702 if led color not black * colorless backlight #707 --- libsrc/jsonserver/JsonClientConnection.cpp | 6 +++--- libsrc/utils/HslTransform.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libsrc/jsonserver/JsonClientConnection.cpp b/libsrc/jsonserver/JsonClientConnection.cpp index 241b97bc..6f402c29 100644 --- a/libsrc/jsonserver/JsonClientConnection.cpp +++ b/libsrc/jsonserver/JsonClientConnection.cpp @@ -532,9 +532,9 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &) } )) { // check if LED Color not Black (0,0,0) - if ((priorityInfo.ledColors.begin()->red != 0) && - (priorityInfo.ledColors.begin()->green != 0) && - (priorityInfo.ledColors.begin()->blue != 0)) + if ((priorityInfo.ledColors.begin()->red + + priorityInfo.ledColors.begin()->green + + priorityInfo.ledColors.begin()->blue != 0)) { // add RGB Value to Array LEDcolor["RGB Value"].append(priorityInfo.ledColors.begin()->red); diff --git a/libsrc/utils/HslTransform.cpp b/libsrc/utils/HslTransform.cpp index 07e9d203..535e1676 100644 --- a/libsrc/utils/HslTransform.cpp +++ b/libsrc/utils/HslTransform.cpp @@ -67,7 +67,7 @@ void HslTransform::transform(uint8_t & red, uint8_t & green, uint8_t & blue) con float l = luminance * _luminanceGain; if (l < _luminanceMinimum) { - saturation *= l/_luminanceMinimum; + saturation = 0; l = _luminanceMinimum; } if (l > 1.0f)