Re: relationship between #xxxxxx color codes and actual pixels?

by Bennett Haselton <bennett(at)peacefire.org>

 Date:  Sun, 01 Jul 2001 00:29:50 -0700
 To:  hwg-graphics(at)hwg.org
 References:  speakeasy
  todo: View Thread, Original
I'm running at 65536 colors (16-bit or "High Color") -- sorry I forgot to 
include that.

However, if my understanding is correct about how the underlying operating 
system interacts with the display adapter, my color settings should only 
affect the way that I see the colors, not their underlying 
representation.  First, I create a page with background color 
"E0E0E0".  Then I open the page and take a screen capture of what it looks 
like, then I open that screen capture in a graphics editing program.  The 
graphics editing program says that the color composition of the pixels in 
that image is "DFDFDF".

As far as I know, my display adapter settings shouldn't affect the 
underlying pixel values.  I might be seeing everything in monochrome, but 
if I set the background color to E0E0E0, then the operating system should 
know that the pixels in that part of the screen have color E0E0E0, even if 
the display adapter can't display it.

So, if the color was "rounded off" from E0E0E0 to DFDFDF, doesn't that mean 
the rounding was done by the *browser*, not the display adapter?

I suspect it may have something to do with the issue of "web safe" colors 
-- is there a FAQ you can point me to?

         -Bennett

At 12:22 AM 7/1/2001 -0700, you wrote:
>welcome to the wonderful world of "web safe" colors.....as for answering
>your question, the only thing i can think of is: are you running at 32bit
>color resolution?
>
>Anthony McLin
>-------------
>
>mclin(at)usc.edu
>http://www.anthonymclin.com
>
>On Sat, 30 Jun 2001, Bennett Haselton wrote:
>
> > If I create one HTML page with
> >
> > <body bgcolor=#DFDFDF>
> > </body>
> >
> > in the source, and another page with
> >
> > <body bgcolor=#E0E0E0>
> > </body>
> >
> > in the source, and view the documents side by side in two open browser
> > windows (either Netscape 4.75 or IE 5.5), the background colors look 
> the
> > same (as they should, since the colors differ by only 1 in the red, 
> green,
> > and blue component).
> >
> > However, if I take a screen capture and then open the screen capture in 
> a
> > graphics program such as Paint Shop Pro, then analyzing the pixels 
> shows
> > that the two windows have *exactly* the same background color,
> > corresponding to an RGB value of #DFDFDF.  Then if I create a graphic 
> in
> > Paint Shop Pro and give it the solid color corresponding to RGB value
> > "#E0E0E0", the color is visibly different from the color of the browser 
>
> > window that is opened on a document with background color #E0E0E0 
> specified
> > in the HTML.
> >
> > What is the relationship between the #xxxxxx color value specified in 
> HTML,
> > and the actual RGB color that will be displayed for that color in the
> > browser window?  Do the browsers keep a list of colors in memory, 
> smaller
> > than the list of 16 million possible colors that can be specified in a
> > #xxxxxx tag, and then "round off" each #xxxxxx-specified color to one 
> of
> > the colors on the shorter list?
> >
> > This is important because I might want to create an image of a circle 
> that
> > will appear against a Web page of a given background color.  Of course 
> I
> > could create a GIF and make the background color of that image 
> transparent,
> > so that the user just sees a circle surrounded by the page background
> > color.  But what if I want the border around the circle to blur/fade 
> from
> > the color of the circle to the color of the background?  As far as I 
> know,
> > you can't do a fade from a solid color to transparent.  You would have 
> to
> > do a fade from the color of the circle to the background color of the 
> Web
> > page -- and, for that, you need to ensure that the color of the pixels
> > around the edge of your image matches the Web page background color.
> >
> >       -Bennett
> >
> > bennett(at)peacefire.org     http://www.peacefire.org
> > (425) 649 9024
> >


bennett(at)peacefire.org     http://www.peacefire.org
(425) 649 9024

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA