Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If you need to calculate the integer representation of a color with an alpha channel, without initialising an image and using the imagecolorallocatealpha function. Then this function might be of some help:
- <?php
- function alphaColor($hexColor,$alpha)
- {
- return bindec(decbin($alpha).decbin(hexdec($hexColor));
- }
- echo alphaColor("FFFFFF",127);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement