colorGrayscale

🌫️ Converts a color to grayscale.

Syntax

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

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

Examples

TypeScript
colorGrayscale({ value: 'red' }); //=> '#808080'
colorGrayscale({ value: '#00ff00' }); //=> '#808080'

Try it

Last updated on
Edit this page