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
Pranjal Agnihotri
4,187 PointsDifference b/w these two [CSS]
Hey everyone , What is the difference b/w representing color in hexadecimal vs in rgb().
1 Answer
Steven Parker
243,656 PointsThe colors produced by a hex value are exactly the same as the colors produced by the "rgb" function. The only difference is how the numeric values of the three color components are represented (hex vs. decimal).
There's also an "rgba" function, which takes an additional argument to set the opacity level at the same time as the color. There's no equivalent to this using the hex values.