Understand HTML colours | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

Understand HTML colours

This section will explain how hexadecimal values are calculated.

12th Jun 2017, 9:09 AM
Sahil Sunny
Sahil Sunny - avatar
4 Answers
+ 12
Every colour is a combination of R, G, B that is Red Green and Blue. In rgb the colour ranges from 0-255. In hexadecimal form its 0-F that means #F00 stands for #RGB since Red position has Highest value and other colours have zero. #F00 stands for red. red can also be represented in #FF0000 and it follows #RRGGBB Now how hexadecimal represents RGB values: In #RRGGBB The first R is multiplied by 16 that is 0 = 0, 1= 16, 2 = 32...F = 240 Second R represents actual value. That is 0 = 0, 1 = 1...F = 15. So #FF0000 is #240+15,0,0 = #255, 0, 0. In short form that is #RGB its R * 16 + R. So #F00 is #15 * 16 + 15, 0, 0 = #255, 0, 0
12th Jun 2017, 9:10 AM
Sahil Sunny
Sahil Sunny - avatar
+ 7
Forget Colors Focus on course 😃
12th Jun 2017, 1:17 PM
Kailash Loncha
Kailash Loncha - avatar
0
super
10th Sep 2017, 3:14 PM
Vaishnavi R
Vaishnavi R - avatar
0
Thanks sahil sunny
28th Jan 2019, 10:56 AM
Eugene Lyngkhoi
Eugene Lyngkhoi - avatar