-2

I am a beginner at HTML and CSS. Why are there are so many color values if each of them can be used for a particular color?

sao
  • 1,835
  • 6
  • 21
  • 40
Afique
  • 1
  • 1
    you search about each type, you understand how it works, you compare all them, you read a bit of history about each one, etc --> you have you answer – Temani Afif Jun 28 '18 at 13:44
  • @Temani Afif k! gonna do that. – Afique Jun 28 '18 at 13:47
  • Consider the fact that computers have proportions of red, green and blue of a pixel under their control, yet humans prefer perceptually-based colour systems. This would be a nice supplement to Temani's suggestion. – enhzflep Jun 28 '18 at 13:47
  • Why the -1 in the answer? It would be cool if you could give a good reason to that. – giovannipds Jul 02 '18 at 20:29

1 Answers1

-1

It's very simple, all of them use different properties, so you have the power to choose whatever is convenient to you.

  • RGB = Red, Green and Blue amount from 0 to 255;
  • HEX = A shorter version of the RGBs amount, you can see how it works here: How does hexadecimal color work?;
  • HSL = Hue (0 to 360), Saturation and Lightness (both 0 to 100), example: https://www.w3schools.com/colors/colors_hsl.asp (I don't like to quote w3schools but you'll get the point there as well) - basically the first it's the color, second how strong it is, third how light or dark it is;
  • RGBA = Same of RGB but it'll include and extra value for Alpha, which is the transparency;
  • Same = Same of HSL but with the Alpha channel mentioned on RGBA as well.
giovannipds
  • 2,860
  • 2
  • 31
  • 39