Darkens the color by reducing the lightness channel by amount of the channel. For example 0.3 means reduce the lightness by 0.3 of the channel's current value.
lightness
amount
0.3
The color to darken or lighten.
Optional
Specify options such as whether to darken or highlight.
import { lightness } from "@skchr/color";// darkening a colorconsole.log(lightness('blue', 0.3, true));// '#464646'// brightening a color, we can omit the final param// because it's false by default.console.log(brighten('blue', 0.3));//#464646 Copy
import { lightness } from "@skchr/color";// darkening a colorconsole.log(lightness('blue', 0.3, true));// '#464646'// brightening a color, we can omit the final param// because it's false by default.console.log(brighten('blue', 0.3));//#464646
Darkens the color by reducing the
lightnesschannel byamountof the channel. For example0.3means reduce the lightness by0.3of the channel's current value.