CSS color codes

L

Leslie

Now that I'm learning that colors can be coded in CSS with a 3 digit
code (rather than the 6 digit rgb code) is there a chart anywhere that
lists the 3 digit codes? I've googled and come up empty. Or, can I
use the 6 digit chart I've had for years and figure out the 3 digit
CSS color code?

Thank you!

Leslie
 
E

Eric Bohlman

Now that I'm learning that colors can be coded in CSS with a 3 digit
code (rather than the 6 digit rgb code) is there a chart anywhere that
lists the 3 digit codes? I've googled and come up empty. Or, can I
use the 6 digit chart I've had for years and figure out the 3 digit
CSS color code?

Each hex digit in a three-digit code is simply doubled up (multiplied by 11
hex) to create the corresponding six-digit code. I.E. #bad is shorthand
for #bbaadd. This means that three-digit codes specify only a subset of
the colors that can be specified by six-digit codes.
 
S

Sid Ismail

: Now that I'm learning that colors can be coded in CSS with a 3 digit
: code (rather than the 6 digit rgb code) is there a chart anywhere that
: lists the 3 digit codes?


No chart. The 3-digit code is an abbreviation.

#CCFFCC = #CFC
#112233 = #123
#121212 = #121212 (can't abbreviate)

Sid
 
R

Richard

: Now that I'm learning that colors can be coded in CSS with a 3 digit
: code (rather than the 6 digit rgb code) is there a chart anywhere that
: lists the 3 digit codes?

No chart. The 3-digit code is an abbreviation.
#CCFFCC = #CFC
#112233 = #123
#121212 = #121212 (can't abbreviate)

The closest 3 digit version to 121212 would be 111.
#CAFACA would still equal #CFC

In essence you have CC + FF + CC to equal the color.
to equate to 3 digit, remove the 2nd digit from each pair.
If red is #FF0000 or #F00, Then #F10000 is nothing more than a lighter shade
of red.
 
S

Sid Ismail

: > : Now that I'm learning that colors can be coded in CSS with a 3 digit
: > : code (rather than the 6 digit rgb code) is there a chart anywhere that
: > : lists the 3 digit codes?
:
:
: > No chart. The 3-digit code is an abbreviation.
:
: > #CCFFCC = #CFC
: > #112233 = #123
: > #121212 = #121212 (can't abbreviate)
:
: > Sid
:
: The closest 3 digit version to 121212 would be 111.
: #CAFACA would still equal #CFC
:
: In essence you have CC + FF + CC to equal the color.
: to equate to 3 digit, remove the 2nd digit from each pair.
: If red is #FF0000 or #F00, Then #F10000 is nothing more than a lighter shade
: of red.
:


What are you on about? We don't want the closest colour - we want that
colour! We're not talking closest to websafe colours (I know 111111
isn't).

Who wanted a _lighter_ shade of red??

Sid
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top