Fix brightness calculation in Icinga\Utils\Color

This commit is contained in:
Johannes Meyer 2014-03-28 15:26:03 +01:00
parent 8e7d1dd8f6
commit c19791fdd7
1 changed files with 3 additions and 3 deletions

View File

@ -132,9 +132,9 @@ class Color {
*/ */
private static function changeRgbBrightness(array $rgb, $change) private static function changeRgbBrightness(array $rgb, $change)
{ {
$red = $rgb[0] + (255 * $change); $red = $rgb[0] + ($rgb[0] * $change);
$green = $rgb[1] + (255 * $change); $green = $rgb[1] + ($rgb[1] * $change);
$blue = $rgb[2] + (255 * $change); $blue = $rgb[2] + ($rgb[2] * $change);
$rgb[0] = $red < 255 ? (int) $red : 255; $rgb[0] = $red < 255 ? (int) $red : 255;
$rgb[1] = $green < 255 ? (int) $green : 255; $rgb[1] = $green < 255 ? (int) $green : 255;
$rgb[2] = $blue < 255 ? (int) $blue : 255; $rgb[2] = $blue < 255 ? (int) $blue : 255;