I know I need to use a loop to look in the $palette
Array, but I need help making the color comparison.
GOAL is to find the nearest value of $rgbcolor
to $palette
and show the color that matches from $palette
.
<?php
//input color
$rgbcolor = array(110,84,43);
//listed color
$palette = array(
array(238,216,152),
array(252,216,113),
array(253,217,0),
array(255,208,62),
array(255,182,20),
array(206,137,0),
array(235,169,0),
array(170,137,0),
array(173,132,28),
array(183,131,0),
array(139,120,37),
array(108,86,26)
);
?>