colorInvert

🔄 Inverts the red, green, and blue components of a color.

Syntax

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

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

Examples

TypeScript
colorInvert({ value: 'white' }); //=> '#000000'
colorInvert({ value: 'black' }); //=> '#ffffff'
colorInvert({ value: 'red' }); //=> '#00ffff'

Try it

Last updated on
Edit this page