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 trialCaroline Jin
970 Pointsrgba function
Should I have to use rgb numbers to put the color for the rgba function? What if I dont know the RGB number for the specific color and I put the number #e088fd for example, or just the word#pink. How can I make the color transparent in certain percentage like rgba function?
2 Answers
Preston Skaggs
11,818 PointsYes, you do have to use RGB values in the RGBA function. If you don't know what the RGB values are you can calculate them, look them up online or use a color picker function online.
Caroline Jin
970 PointsThanks, if I know the 6 digital numbers of the color, how and where can I find the RGB values though?
Preston Skaggs
11,818 PointsSo if you want to calculate the values from your known hexadecimal number you simply break the number into pairs and calculate each as such: For each pair such as XY: (16*X)+Y = R, G or B. more info here http://www.pixel2life.com/publish/tutorials/164/using_php_to_convert_between_hex_and_rgb_values/
Otherwise, you can look at sites like this http://www.colorpicker.com