imagecolorresolve() फंक्शन निर्दिष्ट रंग का इंडेक्स या उसका निकटतम संभव विकल्प प्राप्त करता है।
सिंटैक्स
imagecolorresolve (img , red , green , blue )
पैरामीटर्स
img: imagecreatetruecolor() फंक्शन के साथ बनाई गई इमेज।
red: लाल घटक का मान।
green: हरे घटक का मान।
blue: नीले घटक का मान।
रिटर्न
imagecolorresolve() फंक्शन कलर इंडेक्स लौटाता है।
उदाहरण
निम्नलिखित एक उदाहरण है
<?php
$img = imagecreatefromgif('https://www.tutorialspoint.com/images/html.gif');
$colors = array();
$colors[] = imagecolorresolve($img, 120, 0, 190);
$colors[] = imagecolorresolve($img, 110, 0, 140);
$colors[] = imagecolorresolve($img, 120, 190, 0);
print_r($colors);
imagedestroy($img);
?>
आउटपुट
निम्नलिखित आउटपुट है:
Array ( [0] => 128 [1] => 129 [2] => 130 )