Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
05-05-2009, 06:23 PM #1
- Join Date
- Apr 2009
- Thanked 0 Times in 0 Posts
help with matching colors to image color
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?
05-05-2009, 06:37 PM #2
- Join Date
- Nov 2008
- The Great Pacific NW, USA
- Thanked 6 Times in 6 Posts
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.
05-05-2009, 08:36 PM #3
- Join Date
- Oct 2008
- Some say it's everything.
- Thanked 397 Times in 390 Posts
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 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.
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS:
Seek and you shall find... basically: validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting