Hexadecimal color recognition and matching rules and hexadecimal matching rules

Source: Internet
Author: User

Hexadecimal color recognition and matching rules and hexadecimal matching rules
In CSS, hexadecimal colors are often used to set colors such as text, background, and border. However, for a pure front-end,Hexadecimal color recognition and matchingIt may be unfamiliar. This article briefly introduces some of the hexadecimal color rules.

 

The value of hexadecimal color indicates:

For example, for #1A2BF4 (Case Insensitive), the first two 1A represent R (Red: Red) in RGB, and 2B represents G (Green: green). F4 indicates B (Blue: Blue) in RGB. The value ranges from 00 (0) to FF (255). The higher the value, the deeper the color.

 

Hexadecimal color mixing:

For example, if the values of # FF0000, green, and blue are both 00, while the values of red Are FF, then the color # FF0000 is red, and the values of #550000 are also red, but it is lighter than the values of # FF0000. Similarly, #00FF00 indicates green, and # 0000FF indicates blue.

According to the color mixing principle, it is actually the same as physics. The red-green hybrid (# FFFF00) is yellow, and the red-blue hybrid (# FF00FF) is purple-red (also called foreign red ), the blue-green hybrid (#00 FFFF) is blue, while the red-green hybrid (# FFFFFF) is white,

# The value 000000 is black.

Group # XXYYZZ, XX is the first group, YY is the second group, and ZZ is the third group. Obviously, XX, YY, and ZZ correspond to red, green, and blue respectively.

1. When the first group is large and the remaining two groups are small, the color is red.

2. When the second group is large and the remaining two groups are relatively small, the color is green.

3. When the third group is large and the remaining two groups are relatively small, the color is blue.

4. When the first and second groups are large and the third group is small, the color is yellow.

5. When the first and third groups are large and the second group is small, the color is purple and red.

6. When the second and third groups are large, the first group is relatively small and the color is green.

7. When the three groups are close or equal, the color is gray. You can adjust the gray depth by changing the value size (also known as light and shade). The higher the value, the brighter the value, and the lower the value, the darker the gray depth ). For example, the gray ratio of # e3e3e3 is lighter than that of # a3a3a3. When it approaches (# FFFFFF white), the gray is lighter.

 

Color shade (SHADE ):

The value of a solid color is 0 ~ 255 and 256, corresponding to 00 ~ FF, when the color is in the middle, that is, 256/2 = 128 (converted to a hexadecimal value of 80), it can be seen as the border between the color and shade. For example, if #800000 is dark red, #008000 is dark green, the value is greater, the color becomes brighter, the smaller the value, and the darker the color.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.