...

View Full Version : help with matching colors to image color



grantw
05-05-2009, 06:23 PM
I have a header that fades into a solid color. Then I had a text box under that header in which I made its background the same color that the header faded into. So it looked like the image fading into a solid color. However when I use the same color# of the image color for the text background color its off. I figured this was because I was reducing the quality of the image. So I took the sample off of what was being publised online. So the colors matched in Safari...but didn't in Firefox

Is there a way to make these colors to match?

Or should I just include the text background with my header so its all one image?

mOrloff
05-05-2009, 06:37 PM
If I understand your goal correctly, how about giving this a try?
Put it all in the same div with the desired color as the background. Then (either by also using a bg image with only repeat-x, or a sub div), throw a fading-to-transparent png on top of that.

This way it is the same color, and you get your desired effect.

Rowsdower!
05-05-2009, 08:36 PM
I have a header that fades into a solid color. Then I had a text box under that header in which I made its background the same color that the header faded into. So it looked like the image fading into a solid color. However when I use the same color# of the image color for the text background color its off. I figured this was because I was reducing the quality of the image. So I took the sample off of what was being publised online. So the colors matched in Safari...but didn't in Firefox

Is there a way to make these colors to match?

Or should I just include the text background with my header so its all one image?

Hi grantw.

I'm guessing you are using a PNG format for this but if not, ignore the following:

PNG images carry data within the file for "gamma" data (brightness of the screen/system on which the image was created -- or something like this, anyway). Some browsers support gamma correction while others do not, which is why you will see images appearing to match web colors on some browsers and images not matching web colors on others.

The solution is either to use a different file format (which, yes, is easy but you lose the great quality of the PNG image format) OR you can use a program called PNGCrush (http://pmt.sourceforge.net/pngcrush/) to remove the gamma information from the file, making all browsers treat the image equally and matching the colors to the web hex code you use in your CSS.

I highly recommend option 2.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum