Languages
[Edit]
EN

SCSS - darken color

0 points
Created by:
Krzysiek
741

In this article, we would like to show you how to darken color in SCSS.

Quick solution:

Where:

  • darken() - is a function that decreases lightness of a color by a fixed amount value,
  • red - is a color variable, it can be any color value - rgb / rgba / hex / color name / etc.,
  • $amount - is a percentage value by which the lightness of the color will decrease, it must be a number between 0% and 100%.

Note:

The darken() function is deprecated. To make a color a certain percentage darker than it was before, use color.scale() instead.

 

Practical example

Edit

In this example, we present how to darken variable in which color value is stored.

 

References

Edit
  1. Sass: sass:color - darken

Alternative titles

  1. SCSS - darken color variable
  2. SCSS - make color variable darker
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join