![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
imagecolorresolvealpha() function in PHP
The imagecolorresolvealpha() function is used to get the index of the specified color with alpha.
Syntax
imagecolorresolvealpha (img , red , green , blue , alpha )
Parameters
img: Creates an image with imagecreatetruecolor().
red: The red component
green: The green component
blue: The blue component
alpha: Value between 0 and 127. 0 indicates completely opaque while 127 indicates completely transparent.
Return
The imagecolorresolvealpha() function returns the color index.
Example
The following is an example
<?php $img = imagecreatefromgif('https://www.tutorialspoint.com/images/html.gif'); $colors = array(); $colors[] = imagecolorresolvealpha($img, 120, 0, 190,0); $colors[] = imagecolorresolvealpha($img, 110, 0, 140,0); $colors[] = imagecolorresolvealpha($img, 120, 190, 0,0); print_r($colors); imagedestroy($img); ?>
Output
The following is the output:
Array ( [0] => 128 [1] => 129 [2] => 130 )
Advertisements