183 views

when i give :

<body bgcolor="deepika">

it shows pink color..and

bgcolor="gypsii"

it shows black color..how the conversions would happend??

Category
edited Feb 2, 2016 | 183 views

Selected Ans.

Browsers dont know what red , white , blue ,pink , deepika , gypsii , blah , blah are !

Fact of the matter is they render based on hexadecimal values

For example :

red = #de0000
white = #ffffff

When you take deepika . Lets convert that to suitable hexa code :

deepika -> dee000a (hexadecimal characters are not replaced by 0 , all others are replaced by 0)

dee000a -> dee 000 a00 (make it divisible by 3)

dee 000 a00 -> de 00 a0 (trim third in each part)

At the same time if you take gypsii :

we will have : 0000000 -> Black

Check Hexa and color values here : http://www.w3schools.com/colors/colors_picker.asp

Note :

Consider your name as kevine , you can directly convert as -> #0e000e

Also to convert rgb value to hexadecimal ,check here : http://www.rgbtohex.net/

Some outputs related :

a
10,0,0
#0A0000

a -> 0a

bc
11,12,0
#0B0C00

bc -> 0b0c

def
13,14,15
#0D0E0F

def -> 0d0e0f

ghij
0,0,0
#000000

ghij -> 000000

abcd
171,205,0
#ABCD00

abcd -> #abcd00

efghi
239,0,0
#EF0000

efghi -> #EF0000

applet
160,0,224
#A000E0

applet -> a000e0

deepika
222,0,160
#DE00A0

deepika -> dee 000 a -> de 00 a0

deepika -> #de00

enggforum

enggforum -> 0000 0000 e0
0,0,224
#00 00 E0

These values are from my experiments , and in some case it does not show the output as 1 rule..But as per your question , these names are converted to some hex values and colors are shown thereby

selected Feb 2, 2016 by gypsiii
good explanation...tanq.......

but having some doubts??

when i give "bgcolor=enggforum" it shows blue color..