Public
Authored by Henry Browning

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

i.js 720 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment