diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |