Hex Color Codes - Hex 6 <=> Hex 3

Discussion in 'HTML' started by lucanos@gmail.com, Aug 17, 2005.

  1. Guest

    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
    , Aug 17, 2005
    #1
    1. Advertising

  2. Mark Parnell Guest

    Previously in alt.html, <> 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/
    Mark Parnell, Aug 17, 2005
    #2
    1. Advertising

  3. Guest

    Thanks Mark,

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

    Thanks again,
    Luke
    , Aug 17, 2005
    #3
  4. dorayme Guest

    > From:

    > 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
    dorayme, Aug 17, 2005
    #4
  5. mbstevens Guest

    dorayme wrote:
    >>From:

    >
    >
    >>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.pl?name=python/Critique_Generator
    mbstevens, Aug 17, 2005
    #5
  6. dorayme Guest

    > From: mbstevens <>
    >
    > dorayme wrote:
    >>> From:

    >>
    >>> 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
    dorayme, Aug 18, 2005
    #6
  7. Kevin Scholl Guest

    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/

    ------------------------------------------------------
    Information Architecture, Web Design and Development
    ------------------------------------------------------
    We are the music makers, and we are the dreamers of
    the dreams...
    ======================================================
    Kevin Scholl, Aug 18, 2005
    #7
  8. Neredbojias Guest

    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.
    Neredbojias, Aug 18, 2005
    #8
  9. Neredbojias Guest

    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.
    Neredbojias, Aug 18, 2005
    #9
  10. mbstevens Guest

    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.pl?name=python/Critique_Generator
    (New version 1.2 with macros.)
    mbstevens, Aug 18, 2005
    #10
  11. Neredbojias Guest

    With neither quill nor qualm, Steve Pugh quothed:

    > Neredbojias wrote:
    > > 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?

    >
    > ABD = AABBDD
    > 9BC = 99BBCC
    >
    > A1 = 161, AA = 170, 99 = 153
    > hence A1 is closer to 99 than AA
    >
    > C9 = 201, DD = 221, CC = 204
    > hence C9 is closer to CC than DD
    >
    > So #9BC would be the closest Hex3 version of #A1B7C9
    >
    > Steve


    Duh, yeah, I do that all the time. #abd is *not* #a0b0d0, it's #aabbdd.
    I will write that in a complete sentence 500 times on notebook paper as
    soon as I disconnect.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Aug 19, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg  --
    Replies:
    4
    Views:
    2,138
  2. Bengt Richter
    Replies:
    6
    Views:
    450
    Juha Autero
    Aug 19, 2003
  3. Replies:
    2
    Views:
    2,798
    Malcolm
    Aug 20, 2005
  4. Allen
    Replies:
    1
    Views:
    628
    Mark Rae [MVP]
    Dec 3, 2007
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    390
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page