RGB is a 3-channel format containing data for Red, Green, and Blue.
RGBA is a 4-channel format containing data for Red, Green, Blue, and Alpha.
There is no use to the Alpha channel other than making the color transparent/opaque (or partially transparent; translucent).
In CSS, rgb() had wide browser support for several years before rgba() received the same level of support. This is one reason you will find more rgb() in CSS than rgba(). The other reason is that translucency isn't something you typically use everywhere.
You might find an RGB value packed into 16 bits, with 5 bits for Blue and Red, and 6 bits for Green (green gets more bits because the eye is more discerning to shades of green). You might also find an RGBA value packed into 16 bits, with 5 bits for each color and 1 bit for alpha. With one bit, you can only make the color fully transparent or not transparent at all.
Typically nowadays, you'll find RGB and RGBA packed into 32 bit values, with 8 bits for each color, and 8 bits for alpha (or left blank for RGB).
In CSS, the designers decided to use values 0-255 (the range for an 8 bit value) for the Red, Green, and Blue, but they use a value between 0.0 and 1.0 for the Alpha channel. The actual byte format for the color is irrelevant to web developers.
In my experience, neither rgb() nor rgba() are used very often in CSS. Hex colors are way more dominant, and predated them by several more years.
HSL is actually a much better format for working with colors and is supported in CSS (IE9+, Firefox, Chrome, Safari, and in Opera 10+.).
http://www.w3schools.com/cssref/css_colors_legal.asp
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…