From c19791fdd78ec77a75cb3fd02cfff101d2639918 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 28 Mar 2014 15:26:03 +0100 Subject: [PATCH] Fix brightness calculation in Icinga\Utils\Color --- library/Icinga/Util/Color.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Util/Color.php b/library/Icinga/Util/Color.php index 09c6639b6..575773fca 100644 --- a/library/Icinga/Util/Color.php +++ b/library/Icinga/Util/Color.php @@ -132,9 +132,9 @@ class Color { */ private static function changeRgbBrightness(array $rgb, $change) { - $red = $rgb[0] + (255 * $change); - $green = $rgb[1] + (255 * $change); - $blue = $rgb[2] + (255 * $change); + $red = $rgb[0] + ($rgb[0] * $change); + $green = $rgb[1] + ($rgb[1] * $change); + $blue = $rgb[2] + ($rgb[2] * $change); $rgb[0] = $red < 255 ? (int) $red : 255; $rgb[1] = $green < 255 ? (int) $green : 255; $rgb[2] = $blue < 255 ? (int) $blue : 255;