/dev/null/kevin

Creating something from nothing, or maybe the other way around
All | Chuisms | Computers | Entertainment | Games | Hockey | Humor | Kids | Life | Music | SciFi | Television
20041224 Friday December 24, 2004
What color do you see? Computers

When is grey not grey? When you're viewing it with Internet Explorer, that's when.

The following words should match their color: blue red gray green grey

With most browsers, the word "grey" is the color grey. But when viewed with Internet Explorer on XP, I see it colored green! You might assume that the parser sees "gre" and assumes "green" but the color displayed is a lighter shade of green that what is displayed for the the word "green" (did that make sense?).

The following code was used to display the colored words above:

<font color="blue">blue</font>
<font color="red">red</font>
<font color="gray">gray</font>
<font color="green">green</font>
<font color="grey">grey</font>

I'd be interested in hearing people's explanation for this. I did find this link that describes the same behavior, but doesn't offer any insight.
Tags:
December 24, 2004 12:57 AM PST Permalink | Comments [5] | del.icio.us technorati slashdot digg reddit facebook stumbleupon


Comments:

And why, pray, are you using IE instead of FF ;)

Posted by Trevor Watson on December 24, 2004 at 01:26 AM PST #

I am using Firefox! But as a good web developer, I test on other browsers.

Posted by Kevin on December 24, 2004 at 02:44 AM PST #

Bummer! A month ago I put up a simple website with three nice shades of grey. Unfortunately, for the darkest grey I didn't use color codes, but the word "grey".... and today it turned out that all IE users have been seeing it in glorious shining green. Nice! Err...
Okay, I learned a lesson and will check even simple pages with several browsers.


But here's an interesting link from seven years ago!
A quick test shows that many obscure names for both existing and non-existing color names are translated similarly by Mozilla and IE, but also there are several different interpretations.
Go figure!

Posted by Renne Tergujeff on February 25, 2005 at 12:58 AM PST #

That is both funny and scary. I have to assume that there is a hash table of color names to color codes and that there is more than one way to reach each color code.

Posted by Kevin on February 25, 2005 at 07:48 AM PST #

IE tries to interpret unknown colour names as a RRGGBB hexidecimal number, treating all non-hexidecimal digits as zero. It then seems to pad with extra zeros to get six digits.

So "grey" => 00e0 => 00e000

=> red=0, green=E0=16*14=224/255, blue=0

=> green!

Posted by Tom on February 07, 2008 at 09:19 AM PST #

Post a Comment:

Comments are closed for this entry.
Weblog | Archive of all entries.


Creative Commons License © Kevin Chu, Some Rights Reserved.   This work is licensed under a Creative Commons License.   Sun Microsystems Trademarks are in effect.
All opinons are mine! Mine! Mine! Mine!  Sun Microsystems has nothing to do with them.