Recall & Review
beginner
What does the
lighten() function do in Sass?It makes a color lighter by increasing its lightness by a given percentage.
Click to reveal answer
beginner
How does the
darken() function affect a color in Sass?It makes a color darker by decreasing its lightness by a given percentage.
Click to reveal answer
beginner
Write a Sass code snippet to lighten a blue color by 20%.
$light-blue: lighten(blue, 20%);
Click to reveal answer
intermediate
What happens if you use
darken($color, 100%) in Sass?The color becomes completely black because lightness is reduced to 0%.
Click to reveal answer
intermediate
Why is it better to use
lighten() and darken() instead of hardcoding colors?Because they keep color relationships consistent and make it easier to adjust themes by changing base colors.
Click to reveal answer
What parameter does the
lighten() function take besides the color?✗ Incorrect
The lighten() function takes a color and a percentage to increase its lightness.
If you want to make a color darker by 10%, which function do you use?
✗ Incorrect
The darken() function decreases the lightness of a color by the given percentage.
What will
lighten(red, 0%) return?✗ Incorrect
Using 0% means no change, so the color stays the same.
Which CSS property can be affected by using
lighten() and darken() in Sass?✗ Incorrect
These functions change colors, so they affect properties like background-color.
What is the range of the percentage value used in
lighten() and darken()?✗ Incorrect
The percentage must be between 0% (no change) and 100% (full lightness or darkness).
Explain how the
lighten() and darken() functions work in Sass and give an example of each.Think about how colors get lighter or darker by changing their lightness.
You got /4 concepts.
Why is using
lighten() and darken() functions helpful when designing a website's color theme?Consider how changing one base color can update many related colors.
You got /3 concepts.