Lightens a hex color by a given percentage.
The hex color string.
The percentage to lighten (0-100).
A new hex color string.
// ES Moduleimport { lighten } from '@bnidev/js-utils'// CommonJSconst { lighten } = require('@bnidev/js-utils') Copy
// ES Moduleimport { lighten } from '@bnidev/js-utils'// CommonJSconst { lighten } = require('@bnidev/js-utils')
lighten('#ff0000', 20) // '#ff3333'lighten('#000000', 50) // '#808080' Copy
lighten('#ff0000', 20) // '#ff3333'lighten('#000000', 50) // '#808080'
Lightens a hex color by a given percentage.