কম্পিউটার

PHP-তে imagecolorexact() ফাংশন


imagecolorexact() ফাংশন নির্দিষ্ট রঙের সূচী পায়।

সিনট্যাক্স

imagecolorexact ( $img, $red, $green, $blue )

প্যারামিটার

  • img :imagecreatetruecolor().

    দিয়ে ইমেজ রিসোর্স তৈরি করা হয়েছে
  • লাল :লাল রঙের উপাদান

  • সবুজ: সবুজ রঙের উপাদান

  • নীল :নীল রঙের উপাদান

ফেরত

imagecolorexact() ফাংশন প্যালেটে নির্দিষ্ট রঙের সূচী প্রদান করে, অথবা যদি রঙটি না থাকে তাহলে -1।

উদাহরণ

নিম্নলিখিত একটি উদাহরণ:

<?php
   $img =    imagecreatefrompng('https://www.tutorialspoint.com/assets/videos/courses/67/images/course_67_image.png');
   $colors = Array();
   $colors[] = imagecolorexact($img, 30, 90, 50);
   $colors[] = imagecolorexact($img, 80, 120, 100);
   $colors[] = imagecolorexact($img, 25, 80, 50);
   print_r($colors);
   imagedestroy($img);
?>

আউটপুট

নিম্নলিখিত আউটপুট:

Array ( [0] => 1989170 [1] => 5273700 [2] => 1658930 )

  1. পিএইচপি সর্বোচ্চ() ফাংশন

  2. PHP log10() ফাংশন

  3. পিএইচপি লগ() ফাংশন

  4. পিএইচপি lcg_value() ফাংশন