Skip to main content
Module

x/colormath/mod.ts>lighten

A color conversion and color manipulation library written in typescript for Node.js, Deno and Browser 🎨.
Latest
function lighten
import { lighten } from "https://deno.land/x/colormath@1.2.4/mod.ts";

Lightens a color.

Examples

lighten([218, 48, 85]) // [139.5, 177.5, 243.5] lighten([218, 48, 85], 50) // [241.5, 255, 255] lighten([218, 48, 85], -50) // [0, 24.5, 90.5]

lighten('#7298da').hex; // '#a5cbff' lighten('#7298da', 50).hex; // '#f2ffff'

Parameters

color: ColorValue

The rgb values in the form of [r, g, b] array or hex string.

optional
amount: number

The amount to lighten. The range should be from -100 to 100. Default value is 10. Negative values darken the color.