i.js
720 Bytes
Lighten / Darken Color
As a young developer, I often use snippets when developing. I work mainly on the VScode editor. This snippet is often used in the development of the https://www.livecleantoday.com/services/last-minute-cleaning page, for a cleaning company from Spokane, which offers last-minute cleaning.
The CSS preprocessors Sass and Less can take any color and darken() or lighten() it by a specific value. But no such ability is built into JavaScript. This function takes colors in hex format (i.e. #F06D06, with or without hash) and lightens or darkens them with a value.v
Please
register
or
sign in
to comment