src/Rasterization/Renderers/SVGRenderer.php
private static function prepareColor($color, SVGNode $context)
    {
        $color = Color::parse($color);
        $rgb   = ($color[0] << 16) + ($color[1] << 8) + ($color[2]);

        $opacity = self::calculateTotalOpacity($context);
        $a = 127 - $opacity * intval($color[3] * 127 / 255);

        return $rgb | ($a << 24);
    }
private static function prepareColor($color, SVGNode $context)
    {
        $color = Color::parse($color);
        $rgb   = ($color[0] << 16) + ($color[1] << 8) + ($color[2]);

        $opacity = self::calculateTotalOpacity($context);
        $a = 127 - $opacity * intval($color[3] * 127 / 255);

        return $rgb | ($a << 24);
    }
private static function prepareColor ( $ color , SVGNode $ context ) { $ color = Color :: parse ( $ color ) ; $ rgb = ( $ color [ 0 ] << 16 ) + ( $ color [ 1 ] << 8 ) + ( $ color [ 2 ] ) ; $ opacity = self :: calculateTotalOpacity ( $ context ) ; $ a = 127 - $ opacity * intval ( $ color [ 3 ] * 127 / 255 ) ; return $ rgb | ( $ a << 24 ) ; }
Parses the color string and applies the node's total opacity to it,
then returns it as a GD color int.

@param string  $color   The CSS color value.
@param SVGNode $context The node serving as the opacity reference.

@return int The prepared color as a GD color integer.
Parses the color string and applies the node s total opacity to it then returns it as a GD color int .