|
Advicenators discussion: hexadecimal color codes theymos wrote Wednesday February 14 2007, 9:01 am: HTML uses hexadecimal color codes. Hexadecimal means base 16. Normally we use base 10(decimal). Instead of counting to 9, it counts to 15. So the hexadecimal numbers are:
0=0
1-1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
A=10
B=11
C=12
D=13
E=14
F=15
10=16
...
F0=240(F=15, so 15*16(because it's hexadecimal) equals 256)
...
FF=255(F=15. 15*16=240. 240+15=255)
So to convert from hexadecimal to decimal, take the number in the "tens place", and multiply by 16. Then add the number in the "ones place".
The color code has 4 parts to it:
# -a hash/number symbol
RR -the amount of red
GG -the amount of green
BB -the amount of blue
#RRGGBB -the color code
#000000 is black
#FFFFFF is white
#FF0000 is dark red
#00FF00 is dark green
#0000FF is dark blue
#FFFF00 is yellow
#FF00FF is pink
#00FFFF is cyan
Increasing numbers makes the color brighter, decreasing it makes it darker. It's different then pain, since paint is "subtractive". Color codes are "additive" theymos wrote Monday June 18 2007, 6:36 am: You can test your color codes on my Theymos Web Services template site, here:
[Link](Mouse over link to see full location)
Click "manual". theymos wrote Monday June 18 2007, 6:56 am: Now that I read this again, it isn't entirely clear. Colors go from 0 to 255, darkest to brightest. FF=255. 00=0. F=15. FF=15*16+15, 255.
First number in a 2-digit hexadecimal is always multiplied by 16. Second number is added to the first, after multiplication.
FF --Hexadecimal
F,F --The two hexadecimal numbers
15,15 --Hexadecimal to decimal
15*16,15 --First number is multiplied by 16
240+15 --Second number is added to first
255 --Decimal
A0 --Hexadecimal
A,0 --The two hexadecimal numbers
10,0 --Hexadecimal to decimal
10*16,0 --First number is multiplied by 16
160+0 --Second number is added to first
160 --Decimal
DEADBE -hexadecimal color code
DE,AD,BE -individual hexadecimal numbers
13 14,14 10,11 14 -hexadecimal to decimal
13*16 14,14*16 10, 11*16 14 -first number is multiplied by 16
208+14,224+10,176+14 -second number is added to first
222,234,190 -decimal color codes. 222 Red, 234 green, 190 blue. This turns out to be a pinkish color.
Reply to topicWhoa, hold up there! You have to be logged in to reply to this topic.Register for free!
|