mix
functionMix two colors together. Uses linear interpolation in RGB space.
Import
import { mix } from '@modular/sdk';Notes
- returns
- The mixed color as hex or rgba string
- throws
- Error if color formats are invalid or weight is out of range
- example
- ```ts mix('#ff0000', '#0000ff', 0.5) // => '#800080' mix('#ffffff', '#000000', 0.5) // => '#808080' ```