colorDarken
🌑 Decreases the lightness of a color.
Syntax
TypeScript
import { colorDarken } from '@opentf/std'; colorDarken({ value: ColorInput; amount: number; to?: ColorFormat }): any
value: The input color.amount: A number between0and1.to: The output format (default:'hex').
Examples
TypeScript
colorDarken({ value: '#fff', amount: 0.5 }); //=> '#808080' colorDarken({ value: 'red', amount: 0.2 }); //=> '#990000' colorDarken({ value: 'red', amount: 0.2, to: 'rgba' }); //=> 'rgba(153, 0, 0, 1)'