On HTML is that neccessary to use HEXADECIMAL color codes when we can even use directly with colors name....??? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

On HTML is that neccessary to use HEXADECIMAL color codes when we can even use directly with colors name....???

can any one has answer for this question..? let's see how many solution i get.

13th Jan 2017, 9:04 AM
Anjaneya Karjigi
Anjaneya Karjigi - avatar
3 Respostas
+ 6
You can surely use the color by its name but tell me how many color names you remember? 10? 20? 50? Well it is much harder to remember 256x256x256 color names for a normal human being. So, we use hexadecimal codes or RGB codes. However, there are 16 basic color names are predefined in HTML which can be used by their names. Must check it out on Google.
13th Jan 2017, 11:19 AM
Sachin Artani
Sachin Artani - avatar
+ 3
It isn't 'necessary', but it's useful: most of coders think hexadecimal is more readable than decimal :P ( joke, but true for rgb colors ;) ) And not only you can use named color, but also rgb or rgba decimal system, hsv and others: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
13th Jan 2017, 9:18 AM
visph
visph - avatar
+ 3
Color names aren't precise. There's no rule that states how a browser should render some of the weirder color names. Example "cherry-black": Firefox may render it as #330000 while Chrome renders it as #220000. Two different colors with the same descriptive name. That's why web designers prefer precise color definitions: hex #FF0000 or rgb(255,0,0) or hsl(0,100%,50%)
13th Jan 2017, 9:29 AM
L Cilliers
L Cilliers - avatar