The difference and introduction of ARGB, RGB and RGBA

The difference and introduction of ARGB, RGB and RGBA

ARGB is a color mode, which is the RGB color mode with an Alpha (transparency) channel added, commonly found in the storage structure of 32-bit bitmaps.

The RGB color model is a color standard in the industry. It obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems at present.

RGBA is a color space that represents Red, Green, Blue and Alpha. Although it is sometimes described as a color space, it is really just the RGB model with additional information. The colors used are RGB and can belong to any RGB color space, but Catmull and Smith proposed this indispensable alpha value between 1971 and 1972, making alpha rendering and alpha compositing possible. The proposer named it alpha because the classic linear interpolation equation αA + (1-α)B uses this Greek letter. PNG is an image format that uses RGBA.

The difference between 6-bit and 8-bit values ​​when defining color in Android: 6-bit (#000000) is RGB value 8-bit (#1e000000) ARGB The first two bits are transparency, 00 is completely transparent, ff is completely opaque, and the last 6 bits are RGB values, which are relatively moderate transparency values

What does the a in RGBA mean? How to use RGBA

RGBA Color

RGB is a color standard that produces a variety of colors by varying and superimposing red (R), green (G), and blue (B). To put it simply, RGBA adds a transparency channel Alpha to RGB.
grammar:
rgba (R, G, B, A)
illustrate:
R: red value (Red);
G: Green value (Green);
B: blue value (Blue);
A: Transparency (Alpha);
The three parameters R, G, and B can be positive integers or percentages. The positive integer value ranges from 0 to 255, and the percentage value ranges from 0.0% to 100.0%. Values ​​outside the range will be rounded to the nearest value limit. Not all browsers support the use of percentage values.
Parameter A is transparency, similar to the opacity attribute. Its value range is between 0.0 and 1.0 and cannot be negative. The following is the correct usage of RGBA colors:

rgba(255,255,0,0.5)
rgba(50%,80%,50%,0.5)

Example:

<!DOCTYPEhtml>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS3RGBA Color</title>
<styletype="text/css">
*{padding:0;margin:0;}
ul
{
display:inline-block;
list-style-type:none;
width:200px;
}
li
{
height:30px;
line-height:30px;
font-size:20px;
font-weight:bold;
text-align:center;
}
/*The first li*/
li:first-child
{
background-color:#FF00FF;
}
/*The second li*/
li:nth-child(2)
{
background-color:rgba(255,0,255,0.5);
}
/*The third li*/
li:last-child
{
background-color:#FF00FF;
opacity:0.5;
}
</style>
</head>
<body>
<ul>
<li>123WORDPRESS.COM</li>
<li>123WORDPRESS.COM</li>
<li>123WORDPRESS.COM</li>
</ul>
</body>
</html>

This is the end of this article about the differences and introductions of ARGB, RGB and RGBA. For more information about the differences between ARGB, RGB and RGBA, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

<<: 

>>:  Detailed explanation of HTML tables

Recommend

Analysis of MySQL general query log and slow query log

The logs in MySQL include: error log, binary log,...

MySQL primary key naming strategy related

Recently, when I was sorting out the details of d...

Summary on Positioning in CSS

There are four types of positioning in CSS, which...

In-depth study of JavaScript array deduplication problem

Table of contents Preface 👀 Start researching 🐱‍🏍...

Summary of using the exclamation mark command (!) in Linux

Preface Recently, our company has configured mbp,...

Markup Languages ​​- Lists Again

Click here to return to the 123WORDPRESS.COM HTML ...

How to configure tomcat server for eclipse and IDEA

tomcat server configuration When everyone is lear...

Distinguishing between Linux hard links and soft links

In Linux, there are two types of file connections...

How to configure MySQL master-slave replication under Windows

MySQL master-slave replication allows data from o...

Analysis of mysql view functions and usage examples

This article uses examples to illustrate the func...

CSS border adds four corners implementation code

1.html <div class="loginbody"> &l...

Vue implements Dialog encapsulation

Table of contents Vue2 Writing Vue3 plugin versio...