Challenge - 5 Problems
Sass Color Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding the lighten() function in sass:color module
What is the output color of the following Sass code snippet?
$base-color: #336699; $result: lighten($base-color, 20%); @debug $result;
SASS
$base-color: #336699; $result: lighten($base-color, 20%); @debug $result;
Attempts:
2 left
💡 Hint
The lighten() function increases the lightness of the color by the given percentage.
✗ Incorrect
The lighten() function adds 20% lightness to the base color #336699, resulting in #6699cc.
📝 Syntax
intermediate2:00remaining
Correct usage of adjust-hue() function
Which option correctly changes the hue of the color #ff0000 by 90 degrees using adjust-hue() in Sass?
Attempts:
2 left
💡 Hint
The angle can be given as a number without units, which Sass treats as degrees.
✗ Incorrect
In Sass, adjust-hue() accepts the angle as a number (degrees) or with units like deg or turn. The values 90, 90deg, and 0.25turn are valid and mean 90 degrees. 90% is invalid.
❓ rendering
advanced2:00remaining
Resulting color from mix() function
What is the resulting color of this Sass code?
$color1: #0000ff; $color2: #ff0000; $result: mix($color1, $color2, 25%); @debug $result;
SASS
$color1: #0000ff; $color2: #ff0000; $result: mix($color1, $color2, 25%); @debug $result;
Attempts:
2 left
💡 Hint
The mix() function blends colors weighted by the third parameter, which is the weight of the first color.
✗ Incorrect
mix($color1, $color2, 25%) means 25% of $color1 (#0000ff) and 75% of $color2 (#ff0000). The resulting color is #bf003f.
❓ selector
advanced2:00remaining
Using sass:color functions in a selector context
Given this Sass code, what color will the background be for the .highlight class?
.highlight {
$base: #008000;
background-color: adjust-hue(lighten($base, 10%), 180);
}SASS
.highlight { $base: #008000; background-color: adjust-hue(lighten($base, 10%), 180); }
Attempts:
2 left
💡 Hint
First lighten the green, then rotate the hue by 180 degrees (opposite color).
✗ Incorrect
Lightening #008000 by 10% gives a lighter green (#33cc33). Adjusting hue by 180 degrees shifts green to cyan (#33cccc).
❓ accessibility
expert2:00remaining
Determining contrast ratio with sass:color functions
Using Sass's sass:color module, which option correctly calculates the contrast ratio between #ffffff and #777777?
Attempts:
2 left
💡 Hint
The sass:color module provides a contrast() function to get contrast ratio.
✗ Incorrect
The correct function to get contrast ratio is contrast(). Other options are invalid or do not exist.