SassColour::op_modulo PHP Метод

op_modulo() публичный Метод

Colour modulus
public op_modulo ( mixed $other ) : sassColour
$other mixed value (SassColour or SassNumber) to divide by
Результат sassColour the colour result
    public function op_modulo($other)
    {
        if ($other instanceof SassNumber) {
            if (!$other->isUnitless()) {
                throw new SassColourException('Number must be a unitless number', SassScriptParser::$context->node);
            }
            $this->red = fmod($this->getRed(), $other->value);
            $this->green = fmod($this->getGreen(), $other->value);
            $this->blue = fmod($this->getBlue(), $other->value);
        } elseif (!$other instanceof SassColour) {
            throw new SassColourException('Argument must be a SassColour or SassNumber', SassScriptParser::$context->node);
        } else {
            $this->red = fmod($this->getRed(), $other->getRed());
            $this->green = fmod($this->getGreen(), $other->getGreen());
            $this->blue = fmod($this->getBlue(), $other->getBlue());
        }
        return $this;
    }