colorRotateHue

🎡 Rotates the hue of a color.

Syntax

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

  • degrees: The degrees to rotate (can be negative).

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

Examples

TypeScript
colorRotateHue({ value: 'red', degrees: 120 }); //=> '#00ff00' (lime)
colorRotateHue({ value: 'red', degrees: -120 }); //=> '#0000ff' (blue)

Try it

Last updated on
Edit this page