I have a flat red .png image that I am wanting to change to a specific colour by using CSS filters. I think this is the best approach.
I'm using SASS and by using this I can get the hue, saturation and lightness of a colour. By using a 'red' image it would mean that the rotation degree of the hue is starting at 0 so by using hue-rotate
I would then rotate it, from 0, to the hue degree of the specific colour. Same with saturation and lightness.
filter: hue-rotate(hue(#50e3c2)) saturate(saturation(#50e3c2)) brightness(lightness(#50e3c2));
This outputs as:
filter: hue-rotate(166.53061deg) saturate(72.41379%) brightness(60.19608%);
and if I check what the HSL of the specific colour is...
Hex: #50E3C2
HSL: 167° 72% 60%
RGB: 80 227 194
However when applying this the image is super dark. Looks like the right hue but the saturation and brightness is wrong?
Any thoughts on where I am doing wrong? I had a look at this example: How to calculate required hue-rotate to generate specific colour? but seems to give me the same issue.