Function mix

  • Mix two colors together by a specified weight

    Implementation to the Sass mix function. Returns a color that’s a mixture of color1 and color2. Both the weight and the relative opacity of each color determines how much of each color is in the result.

    Returns

    The mixed color

    Throws

    Invalid Color (color1) if the first color parameter is not a valid color

    Throws

    Invalid Color (color2) if the second color parameter is not a valid color

    Parameters

    • color1: Color

      The first color to be mixed

    • color2: Color

      The second color to be mixed

    • weight: number = 50

      The weight to mix the colors by (0-100). Default is 50

    Returns Color

Generated using TypeDoc