projects
/
pixel-calc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ae53f1a
)
Change colour similarity metric
author
Cameron Ball
<cameron@getapproved.com.au>
Thu, 16 Jul 2015 09:03:46 +0000
(17:03 +0800)
committer
Cameron Ball
<cameron@getapproved.com.au>
Thu, 16 Jul 2015 09:03:46 +0000
(17:03 +0800)
public_html/upload.php
patch
|
blob
|
history
diff --git
a/public_html/upload.php
b/public_html/upload.php
index
cf1e765
..
1baa758
100644
(file)
--- a/
public_html/upload.php
+++ b/
public_html/upload.php
@@
-126,7
+126,7
@@
if(isset($_POST["submit"])) {
$green2 = hexdec(substr($rgb2,2,2));
$blue2 = hexdec(substr($rgb2,4,2));
- return
abs($red1 - $red2) + abs($green1 - $green2) + abs($blue1 - $blue2
) ;
+ return
sqrt(pow($red1 - $red2, 2) + pow($green1 - $green2, 2) + pow($blue1 - $blue2, 2)
) ;
}
function closest_colour($rgb, array $colours) {