summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/index.php b/index.php
index 4fff92d..889d91d 100644
--- a/index.php
+++ b/index.php
@@ -174,9 +174,10 @@ function extract_dominant_color($svg, $algo = 'average', $filter = 'grey')
function clip_color_value($c)
{
- if ($c < 0) return 0;
- else if ($c > 255) return 255;
- return $c;
+ $i = intval(round($c));
+ if ($i < 0) return 0;
+ else if ($i > 255) return 255;
+ return $i;
}
function clip_color($c)