"></div> <?php } ?> <html> <head> </head> <body> <form> <input type="text" name="image" /> <button type="submit">Submit</button> </form> <?php if ($image) { $colors_of_image = new ColorsOfImage($image); $colors = $colors_of_image->getProminentColors(); ?> <p><img src="<?php echo $image; ?> " /></p> Colors of Image: <?php display_colors($colors); ?> <p>Background Color</p> <?php
$b_dist = pow($colorset[2], 2) - pow($mycolor[2], 2); } $totaldist = sqrt($r_dist + $g_dist + $b_dist); if ($totaldist < $tmpdist) { return 'same'; } else { return 'not same'; } //} //return $tmpname; } foreach ($_POST['imgpath'] as $key => $bolanin) { $vcb = explode('+++===', $bolanin); if ($vcb[1] == 'imgarr') { //foreach($bolan as $bolanin){ $colors_of_image = new ColorsOfImage($vcb[0]); $colors = $colors_of_image->getColorMap(); $colorsunique = array_unique($colors); foreach ($colorsunique as $key1 => $color1) { foreach ($colorsunique as $key2 => $color2) { //echo $color1; //echo $color2; if ($color1 != $color2) { if (isset($color1) && isset($color2) && $color1 != '#000000' && $color2 != '#000000') { $colors1 = $colors_of_image->HexToRGB($color1); $colorset = $colors_of_image->HexToRGB($color2); $cvgavl = getcolorname($colors1, $colorset); if ($cvgavl == 'same') { unset($colorsunique[$key1]); } else { }