ixfx

    Function multiplyOpacity

    • Returns a variation of colour with its opacity multiplied by amt. Value will be clamped to 0..1

      // Return a colour string for blue that is 50% opaque
      multiplyOpacity(`blue`, 0.5);
      // eg: `rgba(0,0,255,0.5)`

      // Returns a colour string that is 50% more opaque
      multiplyOpacity(`hsla(200,100%,50%,50%`, 0.5);
      // eg: `hsla(200,100%,50%,25%)`

      Named colours

      Parameters

      • colour: Colourish

        A valid CSS colour

      • amt: number

        Amount to multiply opacity by

      Returns string

      String representation of colour

    MMNEPVFCICPMFPCPTTAAATR