src/Color.php
public function desaturate($amount)
    {
        if ($amount < 0 || $amount > 100) {
            throw new InvalidArgumentException('The given amount must be between 0 and 100');
        }
        $amount /= 100;
        $this->saturation -= $this->saturation * $amount;

        return $this;
    }
public function desaturate($amount)
    {
        if ($amount < 0 || $amount > 100) {
            throw new InvalidArgumentException('The given amount must be between 0 and 100');
        }
        $amount /= 100;
        $this->saturation -= $this->saturation * $amount;

        return $this;
    }
public function desaturate ( $ amount ) { if ( $ amount < 0 || $ amount > 100 ) { throw new InvalidArgumentException ( 'The given amount must be between 0 and 100' ) ; } $ amount /= 100 ; $ this -> saturation -= $ this -> saturation * $ amount ; return $ this ; }
Alters the color by desaturating it with the given percentage.

@param int $amount (0-100) Percentage with which to desaturate the color

@return Color
Alters the color by desaturating it with the given percentage .