When working with colors, you will often see people share colors using these hexadecimal codes, especially if you are doing web design. Most likely, you already use these hexadecimal codes to define colors in HTML or in CSS codes. If we open Krita foreground color selector again, we can see the current color in hexadecimal value down here. hexadecimal color code usually start with a hash mark or sharp symbol like this. In this video, we are going to discuss the underlying structure of this hexadecimal color codes. So later, you can use them confidently and be able to change the color just by tweaking the numbers.
Now, I need to warn you that this lesson might be a bit technical. So if you are not interested, feel free to skip ahead to the next lesson. quick explanation first. These hexadecimal codes can be divided into three groups, each with double digits. So the first two digits are actually for the red color channel, the second two digits are for the green channel. And lastly, the third two digits are for the blue channel.
Okay, you might be wondering by now, how come we have this numbers and letters all mixed up like this. Remember that in standard RGB eight bits per channel images, each channel will have eight digits. And in each digit, we can only have two values which are zero and one. Now, if we divide these eight bits into left wing and right wing, we have four digits at left and four digits at right because we have four probable spaces. And each with two possible values, we can calculate the maximum number of variations we can have and that will be to Power BI for equals to 16 variations in OK, so each wing can have a value between one to 16. But if we start from zero, we get zero to 15 value.
The idea here is how can we write each of this wing with only one digit, not four digits like this. That's when we are using binaries. And not using two digits like this is when we are using decimal. The answer is by writing the value in hexadecimal. So what is actually hexadecimal? Well, we all know about decimal right?
We count from 123 up until nine, then after we reach 10, we actually are doing a loop here we are back in zero, then 11 1213, etc. Basically using this demo, for each 10 value, we are looping the counting order this behavior mostly because we are Human have 10 fingers. Now just imagine here for a second. Let's say you encounter an alien race that has 16 fingers instead of 10. How do you think they will call numbers using decimal system? Not likely.
Big chance they will use hexadecimal system. hexadecimal system loop the counting order, not when it reads the amount of 10. But when it reads 16. Now if we borrow the system, we can use only one digit to refer to the value of each of this wing. But wait, we still have a problem here. We don't have number of symbols greater than nine.
How can we symbolize number 10 1112 until 15 in hexadecimal, then, well, we can hack it. We can use letters instead. So as decimal goes like this 1234 until we reach nine. After that we have 1011 and so on. in hexadecimal, we have 123. Up until nine, we still have the same symbols here.
But when we reach 10, we use letter A, then B 411, and so on until f 415. When we reach 16, then we have been, so then in hexadecimal value is equal to the amount of 16 in decimal value. Okay, so by using the system at one digit space, we can have minimum value of zero, which is equal to the amount of zero also in decimal, and the maximum value of f, which is equal with the amount of 15 in decimal. So now with only six digits, we can define any RGB colors that we like. Sometimes, you will also encounter 3d digits color value are also known as web safe colors. Please don't be confused with these codes.
So basically, they are double values. So for example, if we have 378, like this, the real value for these is actually 3377, a double three, double seven, and double A. Now, we're safe color is a legacy of the old days standard when computers still have limited collars, and also limited bandwidth. Nowadays, they really not important at all. subtle hints when working with hexadecimal values. When all of the value zero, either six digits like 000000 or just 000 using web safe color format.
Both of these numbers mean black, as in RGB color model. No light means black. If we have all of the value set to F, such as F F F, or f f f f f f, this means that the color is white, white is the strongest color as all of the RGB channels are set to its maximum values. Next, we also can tell if the color is grayscale. And that is when each number of our G and B values are identical. So for example, 12 1212 like this, or four e four e four e or CCC, all of these are grayscale color values.