From 45dff6d1d3a8514b3d70e2bb5f803d1b64a04e45 Mon Sep 17 00:00:00 2001 From: Funatiq Date: Tue, 24 May 2016 22:15:39 +0200 Subject: [PATCH] Reduce saturation in backlight (#651) Former-commit-id: c2c4fd6f957c3623e03c37393cf3c03a7a27dc1e --- libsrc/utils/HslTransform.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsrc/utils/HslTransform.cpp b/libsrc/utils/HslTransform.cpp index 8d391adf..07e9d203 100644 --- a/libsrc/utils/HslTransform.cpp +++ b/libsrc/utils/HslTransform.cpp @@ -66,7 +66,10 @@ void HslTransform::transform(uint8_t & red, uint8_t & green, uint8_t & blue) con float l = luminance * _luminanceGain; if (l < _luminanceMinimum) + { + saturation *= l/_luminanceMinimum; l = _luminanceMinimum; + } if (l > 1.0f) luminance = 1.0f; else