Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Hex Color Codes - Hex 6 <=> Hex 3

Reply
Thread Tools

Hex Color Codes - Hex 6 <=> Hex 3

 
 
lucanos@gmail.com
Guest
Posts: n/a
 
      08-17-2005
Hi All,

Probably a simple question, but rest assured I have looked around for
answers before trying to use this forum as my last resort.
(No-one likes the RTFM directive...)

I'm trying to translate the HTML Color Codes between the Hex 6 & Hex 3
standards.
Does anyone know of any online translators to do this?
Or should I simply use basic rounding to change Hex6 to Hex3 (ie
#A1B7C9 becomes #ABD).

I'm just trying to tweak a CSS'd set of pages, and the previous
developer had a penchant for the shorter color codes.

Thanks
Luke

 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      08-17-2005
Previously in alt.html, <(E-Mail Removed)> said:

> Or should I simply use basic rounding to change Hex6 to Hex3 (ie
> #A1B7C9 becomes #ABD).


Any 3-digit value can be expressed as a 6-digit value, e.g. #ABD is
equivalent to #AABBDD.

Most 6-digit values cannot be expressed in 3-digits though. For #A1B7C9,
#ABD is probably the closest, but the 2 colours are significantly
different. http://clarkecomputers.com.au/usenet/hex.html

> I'm just trying to tweak a CSS'd set of pages, and the previous
> developer had a penchant for the shorter color codes.


As above, converting from 3 to 6 is easy - just duplicate each of the 3
digits.

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
 
 
 
lucanos@gmail.com
Guest
Posts: n/a
 
      08-17-2005
Thanks Mark,

I thought that was the case, but always better to have my assumptions
approved by those who know best.

Thanks again,
Luke

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-17-2005
> From: http://www.velocityreviews.com/forums/(E-Mail Removed)

> Probably a simple question, but rest assured I have looked around for
> answers before trying to use this forum as my last resort.
> (No-one likes the RTFM directive...)
>
> I'm trying to translate the HTML Color Codes between the Hex 6 & Hex 3
> standards.
> Does anyone know of any online translators to do this?
> Or should I simply use basic rounding to change Hex6 to Hex3 (ie
> #A1B7C9 becomes #ABD).
>
> I'm just trying to tweak a CSS'd set of pages, and the previous
> developer had a penchant for the shorter color codes.
>



Don't use 3 for the mere sake of shorter colour css specification.
#XXYYZZ is the format of a class of so many colours. This format has a
shorthand of #XYZ. Within this class, the implication goes the other
way too. So one can expand #XYZ to #XXYYZZ.

If you want a larger class of colours, stick to 6. There is nothing
then to gain from 3ing colours that happen to be like #XXYYZZ and lots
to lose, namely a changing of actual colour when 3ing a colour like
#UVWXYZ by some rather arbitrary "rounding". There is unlikely to be a
logical way of doing this to preserve the approx colour without
reference to the colour itself and matching a "close enough" colour
between two sets of colour (in which one is a subset of the other).

dorayme

 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      08-17-2005
dorayme wrote:
>>From: (E-Mail Removed)

>
>
>>Probably a simple question, but rest assured I have looked around for
>>answers before trying to use this forum as my last resort.
>>(No-one likes the RTFM directive...)
>>
>>I'm trying to translate the HTML Color Codes between the Hex 6 & Hex 3
>>standards.
>>Does anyone know of any online translators to do this?
>>Or should I simply use basic rounding to change Hex6 to Hex3 (ie
>>#A1B7C9 becomes #ABD).
>>
>>I'm just trying to tweak a CSS'd set of pages, and the previous
>>developer had a penchant for the shorter color codes.
>>

>
>
>
> Don't use 3 for the mere sake of shorter colour css specification.
> #XXYYZZ is the format of a class of so many colours. This format has a
> shorthand of #XYZ. Within this class, the implication goes the other
> way too. So one can expand #XYZ to #XXYYZZ.
>
> If you want a larger class of colours, stick to 6. There is nothing
> then to gain from 3ing colours that happen to be like #XXYYZZ and lots
> to lose, namely a changing of actual colour when 3ing a colour like
> #UVWXYZ by some rather arbitrary "rounding". There is unlikely to be a
> logical way of doing this to preserve the approx colour without
> reference to the colour itself and matching a "close enough" colour
> between two sets of colour (in which one is a subset of the other).


This would _only_ matter in photo retouching, digital imaging,
and the like. Designing pages with backgrounds and foregrounds
from three hex integers provides more than enough colors. I
find it also makes it easier to tweak the colors -- to find
combinations I like without resorting to a color chart.
--
mbstevens
http://www.mbstevens.com/cgi/mkatt.p...ique_Generator
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-17-2005
> From: mbstevens <(E-Mail Removed)>
>
> dorayme wrote:
>>> From: (E-Mail Removed)

>>
>>> I'm trying to translate the HTML Color Codes between the Hex 6 & Hex 3
>>> standards.
>>> Does anyone know of any online translators to do this?
>>> Or should I simply use basic rounding to change Hex6 to Hex3 (ie
>>> #A1B7C9 becomes #ABD).
>>>

>>
>> Don't use 3 for the mere sake of shorter colour css specification.
>> #XXYYZZ is the format of a class of so many colours. This format has a
>> shorthand of #XYZ. Within this class, the implication goes the other
>> way too. So one can expand #XYZ to #XXYYZZ.
>>
>> If you want a larger class of colours, stick to 6. There is nothing
>> then to gain from 3ing colours that happen to be like #XXYYZZ and lots
>> to lose, namely a changing of actual colour when 3ing a colour like
>> #UVWXYZ by some rather arbitrary "rounding". There is unlikely to be a
>> logical way of doing this to preserve the approx colour without
>> reference to the colour itself and matching a "close enough" colour
>> between two sets of colour (in which one is a subset of the other).

>
> This would _only_ matter in photo retouching, digital imaging,
> and the like. Designing pages with backgrounds and foregrounds
> from three hex integers provides more than enough colors. I
> find it also makes it easier to tweak the colors -- to find
> combinations I like without resorting to a color chart.
> --



I, too, tend to only use the 3 hex lot. But this
may not suit everyone. I have fancied that I
can't *always* get what I want in 3 and so use 6
now and then. But this may be a simple conceit.
Every person needs some to have the pride to go
on.

dorayme


 
Reply With Quote
 
Kevin Scholl
Guest
Posts: n/a
 
      08-18-2005
(E-Mail Removed) wrote:
> Hi All,
>
> Probably a simple question, but rest assured I have looked around for
> answers before trying to use this forum as my last resort.
> (No-one likes the RTFM directive...)
>
> I'm trying to translate the HTML Color Codes between the Hex 6 & Hex 3
> standards.
> Does anyone know of any online translators to do this?
> Or should I simply use basic rounding to change Hex6 to Hex3 (ie
> #A1B7C9 becomes #ABD).


Actually, #9BC would be closer.

> I'm just trying to tweak a CSS'd set of pages, and the previous
> developer had a penchant for the shorter color codes.


Unless there is a direct translation (e.g., #336699 = #369), I
personally wouldn't muck with the color codes. Those few extra bytes of
info aren't likely going to affect anything.

--

*** Remove the DELETE from my address to reply ***

================================================== ====
Kevin Scholl http://www.ksscholl.com/
(E-Mail Removed)
------------------------------------------------------
Information Architecture, Web Design and Development
------------------------------------------------------
We are the music makers, and we are the dreamers of
the dreams...
================================================== ====
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-18-2005
With neither quill nor qualm, Kevin Scholl quothed:

> > Or should I simply use basic rounding to change Hex6 to Hex3 (ie
> > #A1B7C9 becomes #ABD).

>
> Actually, #9BC would be closer.


How do you figure that?

--
Neredbojias
Contrary to popular belief, it is believable.
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-18-2005
With neither quill nor qualm, dorayme quothed:

> >> If you want a larger class of colours, stick to 6. There is nothing
> >> then to gain from 3ing colours that happen to be like #XXYYZZ and lots
> >> to lose, namely a changing of actual colour when 3ing a colour like
> >> #UVWXYZ by some rather arbitrary "rounding". There is unlikely to be a
> >> logical way of doing this to preserve the approx colour without
> >> reference to the colour itself and matching a "close enough" colour
> >> between two sets of colour (in which one is a subset of the other).

> >
> > This would _only_ matter in photo retouching, digital imaging,
> > and the like. Designing pages with backgrounds and foregrounds
> > from three hex integers provides more than enough colors. I
> > find it also makes it easier to tweak the colors -- to find
> > combinations I like without resorting to a color chart.
> > --

>
>
> I, too, tend to only use the 3 hex lot. But this
> may not suit everyone. I have fancied that I
> can't *always* get what I want in 3 and so use 6
> now and then. But this may be a simple conceit.
> Every person needs some to have the pride to go
> on.


Every person needs some for simple contentment.

--
Neredbojias
Contrary to popular belief, it is believable.
 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      08-18-2005
Neredbojias wrote:
> With neither quill nor qualm, dorayme quothed:
>
>
>>>>If you want a larger class of colours, stick to 6. There is nothing
>>>>then to gain from 3ing colours that happen to be like #XXYYZZ and lots
>>>>to lose, namely a changing of actual colour when 3ing a colour like
>>>>#UVWXYZ by some rather arbitrary "rounding". There is unlikely to be a
>>>>logical way of doing this to preserve the approx colour without
>>>>reference to the colour itself and matching a "close enough" colour
>>>>between two sets of colour (in which one is a subset of the other).
>>>
>>>This would _only_ matter in photo retouching, digital imaging,
>>>and the like. Designing pages with backgrounds and foregrounds
>>>from three hex integers provides more than enough colors. I
>>>find it also makes it easier to tweak the colors -- to find
>>>combinations I like without resorting to a color chart.
>>>--

>>
>>
>>I, too, tend to only use the 3 hex lot. But this
>>may not suit everyone. I have fancied that I
>>can't *always* get what I want in 3 and so use 6
>>now and then. But this may be a simple conceit.
>>Every person needs some to have the pride to go
>>on.

>
>
> Every person needs some for simple contentment.


Hoare's Law:
"Inside every large program is a small program
struggling to get out."
C.A.R. Hoare

(I think it applies to CSS markup, too.
Go baroque and you'll go broke.)
--
mbstevens
http://www.mbstevens.com/cgi/mkatt.p...ique_Generator
(New version 1.2 with macros.)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
How to use file I/o codes with form and controls codes Allen ASP .Net 1 12-03-2007 12:04 AM
Virtual Key Codes, Scan Codes and ASCII Codes in C gj_williams2000@yahoo.co.uk C Programming 2 08-20-2005 11:04 AM
RegEx replace of html codes to ascii codes Greg -- ASP .Net 4 08-09-2005 07:27 PM
hex(-5) => Futurewarning: ugh, can't we have a better hex than '-'[:n<0]+hex(abs(n)) ?? Bengt Richter Python 6 08-19-2003 07:33 AM



Advertisments