ixfx
    Preparing search index...

    Function withOpacity

    Does a computation with the opacity of a colour, returning colour.

    Passes operation to HslSpace or SrgbSpace depending on space of colourish.

    Colour

    Function that takes original opacity as input and returns output opacity

    • Does a computation with the opacity of a colour in a RGB structure

      Type Parameters

      Parameters

      • colourish: T

        Colour

      • fn: (scalarOpacity: number) => number

        Function that takes original opacity as input and returns output opacity

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