ixfx
    Preparing search index...

    Function multiplyOpacity

    Multiplies the opacity of a colour by amount, returning a computed CSS colour.

    multiplyOpacity(`red`, 0.5); // Returns a colour string
    

    For example, to half the opacity, use amount: 0.5. Clamps the result to ensure it's between 0..1

    • Type Parameters

      Parameters

      • colourish: T

        Colour

      • amount: number

        Amount

      Returns T extends string
          ? string
          : T extends Hsl
              ? Hsl
              : T extends OkLch ? OkLch : T extends Rgb ? Rgb : never