🧪 Mixes two colors together.

Syntax

TypeScript
import { colorMix } from '@opentf/std';

colorMix(color1: any, color2: any, weight?: number, format?: ColorFormat): any
  • weight: The weight of the first color between 0 and 1 (default: 0.5).

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

Examples

TypeScript
colorMix('white', 'black'); //=> '#808080'
colorMix('red', 'blue'); //=> '#800080'
colorMix('red', 'blue', 0.25); //=> '#4000bf'
Last updated on
Edit this page