In my Invetory WTF script, I include some colored images for certain items to change them to colored versions (pixels, potions, wads, etc.). I do this for some items that are elemetal in nature, or colored in nature.
Currently, this is done by creating colored images of each item, then replacing the original black and white KoL image with the colored WTF version.
In TCRS, I see that some items and images are dynamically colored using Javascript. It would be great to use this method to avoid having to add a bunch of images to the distribution and avoid having to create new colored versions of images all the time.
tcrs.js includes a function: function colorImage(el,el2,hexaColor) that seems to do this somehow (using a canvas and doing something with that). I have spent a bit of time looking over this and realizing this is way beyond my skills. Is anyone here able to help crate a sample script that would color an inventory image, maybe given the item or image and a color #?
Thanks for any help.
Currently, this is done by creating colored images of each item, then replacing the original black and white KoL image with the colored WTF version.
In TCRS, I see that some items and images are dynamically colored using Javascript. It would be great to use this method to avoid having to add a bunch of images to the distribution and avoid having to create new colored versions of images all the time.
tcrs.js includes a function: function colorImage(el,el2,hexaColor) that seems to do this somehow (using a canvas and doing something with that). I have spent a bit of time looking over this and realizing this is way beyond my skills. Is anyone here able to help crate a sample script that would color an inventory image, maybe given the item or image and a color #?
Thanks for any help.