diff options
Diffstat (limited to 'include/colors.php')
-rw-r--r-- | include/colors.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/colors.php b/include/colors.php index 7cf1a6af0..91eaa2dc2 100644 --- a/include/colors.php +++ b/include/colors.php @@ -1,6 +1,8 @@ <?php -require_once "lib/floIcon.php"; +if (file_exists("lib/floIcon.php")) { + require_once "lib/floIcon.php"; +} function _resolve_htmlcolor($color) { $htmlcolors = array ("aliceblue" => "#f0f8ff", @@ -237,16 +239,16 @@ function rgb2hsl($arr) { } else { $s = $del_Max / $var_Max; - $del_R = ((($max - $var_R ) / 6 ) + ($del_Max / 2 ) ) / $del_Max; - $del_G = ((($max - $var_G ) / 6 ) + ($del_Max / 2 ) ) / $del_Max; - $del_B = ((($max - $var_B ) / 6 ) + ($del_Max / 2 ) ) / $del_Max; + $del_R = ((($var_Max - $var_R ) / 6 ) + ($del_Max / 2 ) ) / $del_Max; + $del_G = ((($var_Max - $var_G ) / 6 ) + ($del_Max / 2 ) ) / $del_Max; + $del_B = ((($var_Max - $var_B ) / 6 ) + ($del_Max / 2 ) ) / $del_Max; if ($var_R == $var_Max) $h = $del_B - $del_G; else if ($var_G == $var_Max) $h = (1 / 3 ) + $del_R - $del_B; else if ($var_B == $var_Max) $h = (2 / 3 ) + $del_G - $del_R; - if ($H < 0) $h++; - if ($H > 1) $h--; + if ($h < 0) $h++; + if ($h > 1) $h--; } return array($h, $s, $v); @@ -286,7 +288,8 @@ function hsl2rgb($arr) { $size = @getimagesize($imageFile); - if (!defined('_DISABLE_FLOICON') && strtolower($size['mime']) == 'image/vnd.microsoft.icon') { + if (strtolower($size['mime']) == 'image/vnd.microsoft.icon' && class_exists("floIcon")) { + $ico = new floIcon(); @$ico->readICO($imageFile); |