@bnidev/js-utils
    Preparing search index...

    Function lighten

    • Lightens a hex color by a given percentage.

      Parameters

      • hex: string

        The hex color string.

      • percent: number

        The percentage to lighten (0-100).

      Returns string

      A new hex color string.

      // ES Module
      import { lighten } from '@bnidev/js-utils'

      // CommonJS
      const { lighten } = require('@bnidev/js-utils')
      lighten('#ff0000', 20) // '#ff3333'
      lighten('#000000', 50) // '#808080'