0
How can I know which value stands for a particular colour
When i play challenges in HTML, i see many questions regarding colors, like a hex or RGB colour value is given and i have to find out which colour is that. These are the questions i get stuck in. Can anyone tell me how I can detemine which value stands for what colour? Or is it that i have to memorize all of them?
4 ответов
+ 2
lets get the basic. its RGB (red/green/blue)
the format doent change even in hex format #RRGGBB or #RGB
the number start from 0/00 to f/ff.
0/00 is no color at all
f/ff is the max intensity of that color
now lets break it down from the simplest
#000 / #000000 => is black, because every color has 0
#f00 / #ff0000 => red, red has max but the other has none
#0f0 / #00ff00 => green
#00f / #0000ff => blue
#fff / #ffffff => white
the rest are simply by mixing those color, like magenta/purple-ish color you can mix red and blue element #ff0088
+ 1
If you need to remember how hex values work, then it's pretty simple.
Now, you wont get any complex values because they're a little hard to understand, but look at this:
1. Hex values go from 0-9 and from a-f. Meaning that 00 is the lowest amount of color available, and ff is the highest amount.
The order from as less light to as much is as follows:
f, e, d, c, b, a, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
2. There are three channels in a hex value, red, green and blue, in that order.
3. The structure of a hex value is: #rrggbb. So, if for example we have #ff0000, we know that's the strongest red color the computer has. #0000ff is blue, and #00ff00 is green. Now we can also mix some colors together. For example, #00ffff is cyan, because its a mixture of blue and green.
But these are all simple colors, what about the different numbers and letters? Well, if #ffffff is white, and #000000 is black, then maybe, #555555, will be a kind of dark gray, #bbbbb will be a lighter gray. With other colors, #aaffff is white red.
0
This may help.
https://code.sololearn.com/WX195IlYDnkg/?ref=app