In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Web development about the hexadecimal color code, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
It is necessary to understand the concept of a color system:
RGB:RGB color mode is a color standard in the industry, through the changes of red (R), green (G) and blue (B) channels and their superposition to get a variety of colors. RGB represents the colors of red, green and blue channels. This standard includes almost all the colors that human vision can perceive, and it is one of the most widely used color systems at present. The RGB color mode uses the RGB model to assign an intensity value in the range of 0,255 to the RGB component of each pixel in the image. Using only three colors, RGB images can be mixed in different proportions to reproduce 16777216 colors on the screen.
Below, let's explore the representation principle of RGB through a few pictures.
As we know, the RGB of pure red is (255j0p0), and the hexadecimal color code is # ff0000.
Again, the pure blue RGB is (0jue 0255) and the hexadecimal color code is # 0000ff.
So, from the above two pictures, let's guess what the pure green RGB and hexadecimal color code is.
Yes, G corresponds to 255. the rest of R and B are 0, that is, the pure green RGB is (0pc255 RGB 0) and the hexadecimal color code is # 00ff00.
So how do you implement the RGB > hexadecimal color code, which must be hiding some algorithm? In fact, this is not as abstract as you think.
No.1 in fact, we observed that RGB is separated by commas in the three-digit system, while the hexadecimal color code happens to be # + six-digit values. So we can assume that each value in RGB corresponds to two digits in the hexadecimal color code, namely:
255pr 0 > # ff 00 00
04.0255 > # ff 00 00
No.2 since each hexadecimal color code is hexadecimal, then the value of RGB should also have corresponding digits, so let's try it as a decimal number.
Base 10: 255 > hexadecimal: FF
Hexadecimal: AA > 10: 170
Hexadecimal: B2 > 10: 178
Did you observe anything? It turns out that it is possible, so it can be said that the above two hypotheses are valid. That is, RGB and hexadecimal color codes actually use different bits to count, and through numerical conversion, we achieve color interoperability.
After reading the above, have you mastered the methods of hexadecimal color codes in Web development? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.