I just have a transparent PNG with star graphic in a solid color, let’s say #FF0000;
What can I do to replace or convert to any hex color my user chooses?
I looked on PHP but after trying lot’s of code, nothing seems to work? (for almost all of the imagick functions on PHP.net I get a warning, “This function is currently not documented”)
On my server I run PHP Version 5.2.5
imagick module version : 2.1.1
ImageMagick version: ImageMagick 6.4.1
GD Version: bundled (2.0.34 compatible)
Assuming the star graphic is a uniform color, you can use the following function:
$color should be specified in the RGB hex format, e.g. “#00FF00”.
You can modify the last couple lines if you don’t want to output it directly to the browser.