Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    0
    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?

  • #2
    Regular Coder mOrloff's Avatar
    Join Date
    Nov 2008
    Location
    The Great Pacific NW, USA
    Posts
    422
    Thanks
    8
    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.

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by grantw View Post
    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 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: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •