SassColour::op_bw_and PHP Méthode

op_bw_and() public méthode

Colour bitwise AND
public op_bw_and ( mixed $other ) : sassColour
$other mixed value (SassColour or SassNumber) to bitwise AND with
Résultat sassColour the colour result
    public function op_bw_and($other)
    {
        if ($other instanceof SassNumber) {
            if (!$other->isUnitless()) {
                throw new SassColourException('Number must be a unitless number', SassScriptParser::$context->node);
            }
            $this->red = $this->getRed() & $other->value;
            $this->green = $this->getGreen() & $other->value;
            $this->blue = $this->getBlue() & $other->value;
        } elseif (!$other instanceof SassColour) {
            throw new SassColourException('Argument must be a SassColour or SassNumber', SassScriptParser::$context->node);
        } else {
            $this->red = $this->getRed() & $other->getRed();
            $this->green = $this->getGreen() & $other->getGreen();
            $this->blue = $this->getBlue() & $other->getBlue();
        }
        return $this;
    }