ixfx
    Preparing search index...

    Function interpolator

    • Returns a function to interpolate between colours

      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) => string