'Use a color for a webkit mask on a PNG

I know how to do it via using an image, but it needs to be dynamically changing. Are there any tricks to using a color in place of an image? There appears to be very little documentation on using webkit masks.

I'm using this in a Chrome extension that can be used offline (i.e. I can't use PHP for this).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source