PDA

View Full Version : Name VS Hex



neverrain
January 15th, 2004, 01:55 PM
Hey Everyone,

Now on some big company websites I've been seeing their using the name of the color instead of just typing out the hexadecimal code (e.g. white instead of #FFFFFF).

Why do they use the name instead of the color and which do you believe works better?

-Datapimpinator :sketchy:

P.S. Will #FFF work as #FFFFFF?

abzoid
January 15th, 2004, 05:45 PM
There are two schools of thought on this issue.

One is that the color names are easier to visualize when reading the code, which can make it easier to find the particular snippet you're looking for on large projects, especially where multiple people are working on it at the same time.

Then there are those that don't trust all browsers to interpret the color names the same. The hex codes leave no room for such errors.

I subscribe to the latter.

#FFF is the same as #000FFF, just as the decimal number 444 is the same as 000444.

nobody
January 15th, 2004, 08:00 PM
Actually, I don't know if this is the same in html as it is in css, but I'm just assuming it is...
anywho.. #FFF is equivelant to #FFFFFF.
If 3 "numbers(which they essentially are)" are all that is listed, each character is doubled.
For instance.. #F60 would spit out #FF6600.
I can't say if that works in html for sure or not, but as far as css goes, which is becoming the standard, that's how it works. :)
So yes, #FFF will work

neverrain
January 15th, 2004, 10:20 PM
Will some browsers take #FFF and interpret it diffrent them others or will they all do the same?

I don't work with many many people at the same time it's all about what it shorter and works in ALL browsers.

Thanks for the helpful comments guys! :thumb:

nobody
January 15th, 2004, 10:29 PM
Well all browswers interperet CSS differently. But I would assume that the 3 character variation should be just fine.
Though, if you want to be safe, you might as well bust out the 3 extra keystrokes, it won't kill you, I promise.

abzoid
January 15th, 2004, 10:31 PM
A full six digit hex number is the only thing you can be sure will be interpreted the same in ALL browsers. Remember, if you use anything other than the 212 web safe colors they may still show differently. Particularly on Mac's.

In my opinion the three digit hex codes would only lead to confusion and loss of productivity.

Just my 2¢ worth.

nobody
January 16th, 2004, 06:21 AM
Yeah I really don't like the 3 code thing either, I'd be careful with it.

You really should save yourself the frustration and just get used to the 6 code digit code while you're fresh.