From 74caaca827eaa74f7f3162fe5f846e0af9f7f21e Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Mon, 4 Mar 2019 11:15:01 +0100 Subject: [PATCH] fix travis errors --- htdocs/core/lib/functions2.lib.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index dd557fa0a51..9ab2b2c1aca 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2222,7 +2222,8 @@ function colorValidateHex($color, $allow_white = false) * @param integer $steps * @return string */ -function colorAdjustBrightness($hex, $steps) { +function colorAdjustBrightness($hex, $steps) +{ // Steps should be between -255 and 255. Negative = darker, positive = lighter $steps = max(-255, min(255, $steps)); @@ -2250,7 +2251,8 @@ function colorAdjustBrightness($hex, $steps) { * @param integer $percent 0 to 100 * @return string */ -function colorDarker($hex, $percent) { +function colorDarker($hex, $percent) +{ $steps = intval(255 * $percent / 100 ) * -1; return colorAdjustBrightness($hex, $steps); } @@ -2260,7 +2262,8 @@ function colorDarker($hex, $percent) { * @param integer $percent 0 to 100 * @return string */ -function colorLighten($hex, $percent) { +function colorLighten($hex, $percent) +{ $steps = intval(255 * $percent / 100 ); return colorAdjustBrightness($hex, $steps); } @@ -2272,7 +2275,8 @@ function colorLighten($hex, $percent) { * @param bool $returnArray : * @return string */ -function colorHexToRgb($hex, $alpha = false, $returnArray = false) { +function colorHexToRgb($hex, $alpha = false, $returnArray = false) +{ $string = ''; $hex = str_replace('#', '', $hex); $length = strlen($hex); @@ -2294,7 +2298,6 @@ function colorHexToRgb($hex, $alpha = false, $returnArray = false) { else{ return $string; } - }