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 trialDj Dimick
7,907 PointsDoes the Color Palette variables within Sass work with RGBA values or just the Hexadecimal?
Can this be used for the other coloring styles rather than just Hexadecimal?
1 Answer
Máté Végh
25,607 PointsYes, they do! In Sass you can specify your colors in almost any color value: HEX, RGB, RGBA, HSL, HSLA
Sass:
$hex: #007FFF;
$rgb: rgb(0,127,255);
$rgba: rgba(0,127,255,.5);
$hsl: hsl(210,100%,50%);
$hsla: hsla(210,100%,50%,.5);
.element {
color: $hex;
color: $rgb;
color: $rgba;
color: $hsl;
color: $hsla;
}
CSS:
.element {
color: #007FFF;
color: #007fff;
color: rgba(0, 127, 255, 0.5);
color: #007fff;
color: rgba(0, 127, 255, 0.5);
}
Try it out on www.sassmeister.com
Adnan Pozegić
12,789 PointsAdnan Pozegić
12,789 PointsAlso keep an eye on that pesky IE support, from the reference: