@skchr/color
    Preparing search index...

    Function lightness

    • 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.

      Parameters

      • color: ColorToken

        The color to darken or lighten.

      • Optionaloptions: LightnessOptions

        Specify options such as whether to darken or highlight.

      Returns ColorToken

      • The darkened or lightened color token.
      import { lightness } from "@skchr/color";

      // darkening a color
      console.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