src/Rasterization/Renderers/SVGRenderer.php
private static function getNodeOpacity(SVGNode $node)
    {
        $opacity = $node->getStyle('opacity');

        if (is_numeric($opacity)) {
            return floatval($opacity);
        } elseif ($opacity === 'inherit') {
            $parent = $node->getParent();
            if (isset($parent)) {
                return self::getNodeOpacity($parent);
            }
        }

        return 1;
    }
private static function getNodeOpacity(SVGNode $node)
    {
        $opacity = $node->getStyle('opacity');

        if (is_numeric($opacity)) {
            return floatval($opacity);
        } elseif ($opacity === 'inherit') {
            $parent = $node->getParent();
            if (isset($parent)) {
                return self::getNodeOpacity($parent);
            }
        }

        return 1;
    }
private static function getNodeOpacity ( SVGNode $ node ) { $ opacity = $ node -> getStyle ( 'opacity' ) ; if ( is_numeric ( $ opacity ) ) { return floatval ( $ opacity ) ; } elseif ( $ opacity === 'inherit' ) { $ parent = $ node -> getParent ( ) ; if ( isset ( $ parent ) ) { return self :: getNodeOpacity ( $ parent ) ; } } return 1 ; }
Obtains the node's very own opacity value, as specified in its styles,
taking care of 'inherit' and defaulting to 1.

@param SVGNode $node The node to get the opacity value of.

@return float The node's own opacity value.
Obtains the node s very own opacity value as specified in its styles taking care of inherit and defaulting to 1 .