Skip to main content
Module

x/colormath/dist/index.d.ts>darken

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

Darkens a color.

Examples

darken([218, 48, 85], 50) // [0, 24.5, 90.5] darken([218, 48, 85], -50) // [241.5, 255, 255]

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 darken. The range should be from -100 to 100. Default value is 10. Negative values lighten the color.