darken
functionDarken a color by a percentage. Works in HSL space for perceptually uniform results.
Import
import { darken } from '@modular/sdk/theme';Notes
- returns
- The darkened color as hex or rgba string
- throws
- Error if the color format is invalid or amount is out of range
- example
- ```ts darken('#ffffff', 50) // => '#808080' darken('#ff0000', 20) // => '#990000' ```