1

CSS color codes are RR GG BB. So how does #26c relate to a shade of blue?

Edit:
Wow thanks for everyones help - I'll mark the answer of the one who appears to have put most effort in

4 Answers 4

5

#26c is a Websafe hexadecimal colorcode. Hexadecimal colors are usually 6 characters long, for example black is #000000 and white is #ffffff. Websafe colors are only three characters long that double up, so #26c becomes #2266cc.

The reason why this relates to a shade of blue is because of the way Hexadecimal codes are calculated. 22 represents the amount of RED in the color from 1 to 255, 66 represents the amount of green in the code and CC represents the points of blue.

But how can CC represent an amount?

Well I'm glad you asked, computers like to count in amounts of EIGHT digits and so have developed a number system based on powers of 16, so you don't start over til you get to 16, but from 11 - 15 you use letters. So 10 is A, 11 is B, 12 is C, 13 is D 14 is E and 15 is F.

So when calculated using Hexadecimal, CC becomes 204 (12+12x16), meaning 204 points of blue in the color. this being the highest value, will mean the color is mostly blue :)

#000000 means 0 red, 0 green and 0 blue, that's why it is black, totally devoid of color. #ffffff means 255 red, 255 green and 255 blue, that's why it is white, all the colors added together makes white. And all the colors in between can be calculated this way :)

Hope that helps. :)

Sign up to request clarification or add additional context in comments.

7 Comments

OMG, man, that's one of the most exhaustive answers I've seen :D.
'Well I'm glad you asked' - I didn't ask. I know how hexadecimal works - it was the shorthand I was asking about. Thanks all the same but no upvote
You asked "So how does #26c relate to a shade of blue?" I explained. You didn't say you knew how hexadecimal worked :)
@m.edmondson: You wrote you'd mark the answer of the one who puts the most effort in it. Kyle obviously did, yet you refuse to even upvote it? This is wrong, man, such attitude makes me want to quit answering questions on SO myself.
The original web-safe palette only used the digits 0, 3, 6, 9, C and F, so #26C wouldn't have qualified.
|
4

This is the shortcut version of css, it renders as #2266CC

CC being the higher value, it should look a little blue at lease :D

Comments

2

It's a compact way of writing #2266CC

Comments

0

It's short hand, CSS doubles up each of the 3 digit codes to read #2266CC

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.