Function interpolator

Returns a function to interpolate between colours

import { Colour } from 'https://unpkg.com/ixfx/dist/visual.js'
const i = interpolator([`orange`, `yellow`, `red`]);

// Get a random colour on the above spectrum
i(Math.random());

Results will vary depending on the colour space used, play with the options. When using a hue-based colour space, the hue option sets the logic for how hue values wrap.

interpolator([`orange`, `yellow`, `red`], { space: `hsl`, hue: `longer })
  • Parameters

    Returns ((amt: number) => Color)

      • (amt): Color
      • Parameters

        • amt: number

        Returns Color