assign filter to png with javascript
Moderator: General Moderators
assign filter to png with javascript
is there a way to assign a filter or something to a png image with javascript? I have a bunch of icons that need to be different colors depending on a value in the database and it would be so easy if I could just change their color with javascript (requiring js is ok on this particular site since it's in-house)
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I doubt it, although you could dynanamically generate the icons with different color. Still, whats wrong with just serving different images depending on the value?
Edit | This may be of interest http://www.dynamicdrive.com/forums/showthread.php?t=948
Edit | This may be of interest http://www.dynamicdrive.com/forums/showthread.php?t=948
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Why not dynamically generate them if you have a large base. Have one standard icon, and change the hue depending on which variable you call.The Ninja Space Goat wrote:Well, I can serve different images, it would just be easy if they were dynamically colored, but that's ok.. it's just kind of a lot of icons I have to create but that's life.
Code: Select all
<img src="/icon.php?id=4&color=red" alt="im an icon" />