colorLighten

💡 Increases the lightness of a color.

Syntax

TypeScript
import { colorLighten } from '@opentf/std';
colorLighten({ value: ColorInput; amount: number; to?: ColorFormat }): any
  • value: The input color.

  • amount: A number between 0 and 1.

  • to: The output format (default: 'hex').

Examples

TypeScript
colorLighten({ value: '#000', amount: 0.5 }); //=> '#808080'
colorLighten({ value: 'red', amount: 0.2 }); //=> '#ff6666'
colorLighten({ value: 'red', amount: 0.2, to: 'hsl' }); //=> 'hsl(0, 100%, 70%)'

Try it

Last updated on
Edit this page