color: {
    colord: ((input: AnyColor | Colord) => Colord);
    fade: ((steps: number, from: Colord, to: Colord) => Colord[]);
    getRandomColor: ((isLight?: boolean) => Colord);
    random: (() => Colord);
} = ...

Type declaration

  • colord: ((input: AnyColor | Colord) => Colord)
  • fade: ((steps: number, from: Colord, to: Colord) => Colord[])
      • (steps: number, from: Colord, to: Colord): Colord[]
      • Fade between two colors. Returns an array of Colord objects.

        Returns

        Array of Colord objects.

        Parameters

        • steps: number

          Amount of steps to fade between the two colors. Minimum 3.

        • from: Colord

          Color to fade from. Should be a Colord object.

        • to: Colord

          Color to fade to. Should be a Colord object.

        Returns Colord[]

  • getRandomColor: ((isLight?: boolean) => Colord)
      • (isLight?: boolean): Colord
      • Get a random color. You can specify if you want a light or dark color, which is based on Colord.brighness().

        Returns

        Colord object.

        Example

        const randomColor = getRandomColor();
        const randomLightColor = getRandomColor(true);
        const randomDarkColor = getRandomColor(false);

        Parameters

        • Optional isLight: boolean

          (Optional) If true, the color will be light. If false, the color will be dark. If undefined, the color will be random.

        Returns Colord

  • random: (() => Colord)

Generated using TypeDoc