BluePink BluePink
XHost
Servere virtuale de la 20 eur / luna. Servere dedicate de la 100 eur / luna - servicii de administrare si monitorizare incluse. Colocare servere si echipamente de la 75 eur / luna. Pentru detalii accesati site-ul BluePink.
enter page web design web resource entertainment personals  
Colors:
Color tips
Color list - by names
Color list - by 2
Color list - by 3
Color wheel
Color picker
HEX-RGB converter
Background list changer
Text:
Characters list
Characters list 2
Web:
Body bg properties
CSS problems in NN4
CSS mechanism
Web domains
Browsers chart
Source viewer
Form example
Form order

home > real world > web resource > web utility programs >

RGB vs HEX

RGB stands for Red - Green - Blue.
Any of the Red-Green-Blue value is only between 0 - 255: 0 for the lowest content of that color, 255 for the highest content of the same color.
The format of an RGB color is: (I give you a random color) 128-34-246 (I don't know what color is this, but you can find it with the Color picker tool).
RGB can be from 0-0-0 (black) to 255-255-255 (white).

HEX is the same with RGB (red-green-blue), but in different format: each tent is 2 digits: 00, 2A, FF, etc.
HEX values are between 0 - 9 and A - F: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
So we increase the color from 00 (black) to FF (white) like: 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, and we start again with 1: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A ... 1F, and then 20, 21, 22 ... 2F and so on. And we finish with F1, F2, F3, F4, F5, F6, F7, F8, F9, FA, FB, FC, FD, FE, FF.
The format of an HEX color is: (for example) 8022F6 (this is the equivalent of the above RGB color, 128-34-246, but don't tell anyone). 80 stands for the Red value (equiv. 128 RGB), 22 for the Green value (34 RGB) and F6 for the Blue value (246 RGB).

How did I find the equivalence? Read further.

Converting RGB to HEX

Mind that HEX is 16 characters wide, and 16x16=256 (RGB, isn't it? - Attention! from 0 to 255 are 256 units, not 255; from 1 to 255 are 255 units - trust me, I know what I'm doing).

So the colors convert from RGB to HEX by 16. Thus, every 16 RGB makes a 10 HEX. 32 RGB = 20 HEX. 48 RGB = 30 HEX. And so on. Mind that the first integer is for the exact result, and the second is for the remaining.

Exercise: For example, if we want to know what HEX value is 128 RGB, we divide 128 by 16 and we find 8. So 16 is 8 times within 200; a 16 RGB is 10 HEX; by 8 it equals 80: so 128 RGB = 80 HEX.

Exercise: Now let's try to calculate another HEX value from an RGB one.
I take for instance the random value of 200 RGB.
First, we divide 200 by 16, and we find 12.5. More exactly, the result is 12 and remain 8.
Because 16 is 12 times within 200, the first HEX value will be C.
Now we have a remain of 8, which is the same on HEX, 8, so the second value will be 8.
So, finally, the 200 RGB will be C8 HEX.
If you don't believe it, try for yourself with the HEX-RGB converter tool.

For your comfort, I built the following Conversion chart.

Conversion chart

CONVERSION CHART
  0 - 15 RGB    ::    0 HEX
RGB 0123456789101112131415
HEX 0123456789ABCDEF
  16 - 31 RGB    ::    1 HEX
RGB 16171819202122232425262728293031
HEX 101112131415161718191A1B1C1D1E1F
  32 - 47 RGB    ::    2 HEX
RGB 32333435363738394041424344454647
HEX 202122232425262728292A2B2C2D2E2F
  48 - 63 RGB    ::    3 HEX
RGB 48495051525354555657585960616263
HEX 303132333435363738393A3B3C3D3E3F
  64 - 79 RGB    ::    4 HEX
RGB 64656667686970717273747576777879
HEX 404142434445464748494A4B4C4D4E4F
  80 - 95 RGB    ::    5 HEX
RGB 80818283848586878889909192939495
HEX 505152535455565758595A5B5C5D5E5F
  96 - 111 RGB    ::    6 HEX
RGB 96979899100101102103104105106107108109110111
HEX 606162636465666768696A6B6C6D6E6F
  112 - 127 RGB    ::    7 HEX
RGB 112113114115116117118119120121122123124125126127
HEX 707172737475767778797A7B7C7D7E7F
  128 - 143 RGB    ::    8 HEX
RGB 128129130131132133134135136137138139140141142143
HEX 808182838485868788898A8B8C8D8E8F
  144 - 159 RGB    ::    9 HEX
RGB 144145146147148149150151152153154155156157158159
HEX 909192939495969798999A9B9C9D9E9F
  160 - 175 RGB    ::    A HEX
RGB 160161162163164165166167168169170171172173174175
HEX A0A1A2A3A4A5A6A7A8A9AAABACADAEAF
  176 - 191 RGB    ::    B HEX
RGB 176177178179180181182183184185186187188189190191
HEX B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF
  192 - 207 RGB    ::    C HEX
RGB 192193194195196197198199200201202203204205206207
HEX C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF
  208 - 223 RGB    ::    D HEX
RGB 208209210211212213214215216217218219220221222223
HEX D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF
  224 - 239 RGB    ::    E HEX
RGB 224225226227228229230231232233234235236237238239
HEX E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
  240 - 255 RGB    ::    F HEX
RGB 240241242243244245246247248249250251252253254255
HEX F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF

© copyright 2004 - DigitalElf.ro - marian_dumitriu@yahoo.com