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);
    }