Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics (2014) Understanding Values and Units Color Values

Osama Mansour
Osama Mansour
1,411 Points

when do i use the rgba ?

what does the percentage or the decimal number in the rgba function do to the color? when do i use the rgba function ? what is the difference between rgba and rgb?

1 Answer

Walter Allen
seal-mask
.a{fill-rule:evenodd;}techdegree
Walter Allen
iOS Development with Swift Techdegree Student 16,023 Points

In rgba and rgb, the 'r' stands for 'red,' the 'g' stands for 'green,' and the 'b' stands for blue. In rgba, the 'a' stands for 'alpha.' What the alpha value does is create an opacity or transparency for the color. For example, and alpha value of 1 is completely opaque, while an alpha value of 0 is complete transparent. A value in between, i.e. .5, or 50%, is half-transparent.

Does that help? You can read more here: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgba.

Walter Allen
seal-mask
.a{fill-rule:evenodd;}techdegree
Walter Allen
iOS Development with Swift Techdegree Student 16,023 Points

No problem. If it answered your question, do me a favor and upvote/mark it as best answer. If not, let me know what other question you have and I'll try to answer it. :) Happy programming!

Thank you.

Shaked Gvirtsman
Shaked Gvirtsman
2,270 Points

Thank you. Really helped me:)