Have a css script with colourful filter:
@keyframes rainbowEffect {
from {filter: brightness(0.5) sepia() saturate(4) hue-rotate(0deg);}
to {filter: brightness(0.5) sepia() saturate(4) hue-rotate(360deg);}
}
.infiniteRainbow {
animation: rainbowEffect 10s linear infinite;
}
loading the script as: <link rel="stylesheet" href="scripts/colorful.css">
Then I have a bunch of images loaded with different categories, supposed that if the category of the image is/equals colourful, then apply the rainbow effect (filter) on them. But not sure what to write in drawImage()...
var t = deconstructImage(selected).clearName;
c = document.getElementById("frontground").getContext("2d");
if (data[t].cat === "Colourful" && !locked) {
c.drawImage(document.getElementById(data["Colour man"].file) "what to write here???" )
}
Thanks.