What are the differences between RGB and RGBA, other than "opacity",

I went beyond the standard colors in CSS by declaring them orange , blue , aquamarine , etc ... and used rgb() for the same colors, respectively rgb(255,165,0) , rgb(0,0,255) and rgb(127,255,212) (thanks to the ColorHighlighter package in ST3).

When changing the gradient for the .btn bootstrap .btn I came across rgba() . A brief study explains that a stands for alpha , and theres is a whole bunch of integral math attributed to Catmull and Smith . It is also fairly easy to find that the alpha channel is used for the "alpha composition", which can mainly be related as "opacity."

  • Are there differences between the two other than opacity?
  • Why is it not an agreement to use RGBA. (I guess this is because I just stumbled upon it now)
  • Are there other restrictions you should know when using rgba () for on the Internet?
  • Is there a label for declaring opacity next to the color label? (i.e. color: salmon:.5; )
  • From a web developer point of view, do I need to worry about the difference between ARGB, RGBA, BGRA bytes for different INFO machines?
  • Other important information?
+12
css rgb argb
Jul 02 '14 at 18:31
source share
3 answers

RGB is a three-channel format containing data for red, green, and blue. RGBA is a 4-channel format containing data for Red, Green, Blue and Alpha.

For the alpha channel, there is no need to use the color transparent / opaque (or partially transparent, translucent).

In CSS, rgb () had extensive browser support for several years before rgba () received the same level of support. This is one of the reasons you will find more rgb () in CSS than rgba (). Another reason is that transparency is not something you usually use everywhere.

You can find an RGB value packed in 16 bits, with 5 bits for blue and red and 6 bits for green (green gets more bits because the eye is more perceptive for shades of green). You can also find the RGBA value packed in 16 bits, with 5 bits for each color and 1 bit for alpha. With one bit, you can make the color completely transparent or not transparent at all.

Usually at present you will find RGB and RGBA packed in 32-bit values, with 8 bits for each color and 8 bits for alpha (or left blank for RGB).

In CSS, designers decided to use values ​​0-255 (range for an 8-bit value) for red, green, and blue, but they use a value between 0.0 and 1.0 for the alpha channel. The actual byte format for color is not relevant to web developers.

In my experience, neither Rgb () nor rgba () are used very often in CSS. Hake colors are more dominant and precede a few more years.

HSL is actually a much better format for working with colors and is supported in CSS (IE9 +, Firefox, Chrome, Safari, and Opera 10+.).

http://www.w3schools.com/cssref/css_colors_legal.asp

+18
Jul 02 '14 at 18:46
source share

RGB is the standard rgb color, you already understand that.

RGBa - standard rgb colors, but with alpha transparency.

In addition, there is no difference, the colors are still the same.

The problem with using this and other CSS3 styles is that it is not always supported. Here is the link I found that tells you which browser versions support it.

The alpha declaration in CSS will look like rgba (0, 0, 0, .3) , with alpha being a decimal or integer from 1 to 0 . 1 is opaque and 0 is completely transparent.

+1
Jul 02 '14 at 18:50
source share

rgb - standard rgb values ​​(red, green, blue)

rgba - standard rgb values ​​(red, green, blue + alpha (aka opacity))

You will not find any color variations. RGBA is a css3 color property.

Since support for older browsers may be limited, you can use fallback color as such:

CSS

 div { background-color: rgb(200, 54, 54); /* The Fallback */ background-color: rgba(200, 54, 54, 0.5); } 
0
Jul 02 '14 at 18:35
source share



All Articles