tags:

views:

88

answers:

2

In CSS, is there a standard way to colorize or apply a tint to a grayscale image?

I would like to create a grayscale image to show focus over an element, and allow the color of the focus to be configurable by colorizing the grayscale image.

Thanks

+5  A: 

You could change the alpha and have a solid background color behind it.

used2could
This could work, however I was hoping to use an image gradient.
Steve
Here is a link to a cross-browser css gradient http://www.webdesignerwall.com/tutorials/cross-browser-css-gradient/
used2could
A: 

If you use a gradient with alpha-channel you can use absolute-positioning and put it on-top of your image. If you can't make a gradient with an alpha-channel then you can adjust the opacity of the overlay using CSS, but the effect isn't as good.

I used this for an mouseover area-selection for a map and it worked quite well.

Diodeus