<?php $img = imagecreatefrompng( 'https://www.tutorialspoint.com/assets/videos/courses/19/images/course_19_image.png'); imagetruecolortopalette($img, false, 255); $val = imagecolorclosest($img, 20, 90, 140); $val = imagecolorsforindex($img, $val); $val = "({$val['red']}, {$val['green']}, {$val['blue']})"; echo "Closest = " . $val; imagedestroy($img); ?>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more