Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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:)