开发者

php, gd, color switching with antialiasing and shadows

I want to make a wordpress theme with a color picker to switch the main color(s) of the theme. At some points of the theme the colors I want to change could be in images - maybe when it comes to rounded corners, overlapping stuff or anything else that couldn't be easily done in plain CSS.

I planned to take care of those things using a color switching function in GD. However, as I have basically no experience with GD I first wanted to make sure if those color switching functions can take care of shadows, antialiasing and stuff like that. The examples I found yet all just changed one plain color to another plain color.

Is there a trick to do that with GD and if yes, can you give me a link to a tutorial or a good example?

Than开发者_如何学运维k you!


It'd be better to replace all those fixed-color-antialias images with .png images with appropriate transparency set on any bits that need to be merged with the background. That way you only have one set of images for the theme, instead of one-set-per-color-scheme, which could quickly get unmanageable.


Plenty of colorize algorithms:

http://php.net/manual/en/function.imagefilter.php

You should also find something nice in google searching for "php colorize"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜