Colors
colorDesaturate

🧊 Decreases the saturation of a color.

Syntax

import { colorDesaturate } from '@opentf/std';
 
colorDesaturate(input: ColorInput, amount: number, format?: ColorFormat): any
  • amount: A number between 0 and 1.
  • format: The output format (default: 'hex').

Examples

colorDesaturate('red', 0.5); //=> '#bf4040'
colorDesaturate('red', 0.5, 'rgba-object'); //=> { r: 191, g: 64, b: 64, a: 1 }

Try