colorDesaturate

🧊 Decreases the saturation of a color.

Syntax

TypeScript
import { colorDesaturate } from '@opentf/std';
colorDesaturate({ 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
colorDesaturate({ value: 'red', amount: 0.5 }); //=> '#bf4040'
colorDesaturate({ value: 'red', amount: 0.5, to: 'rgba-object' }); //=> { r: 191, g: 64, b: 64, a: 1 }

Try it

Last updated on
Edit this page