Sometimes it's so simple... yes that works. 

I've found an old post which does someting like this:

        public static Color getFillColor(Element element) {
                Document doc = element.getOwnerDocument();
                ViewCSS viewCSS = (ViewCSS) element.getOwnerDocument()
                                .getDocumentElement();

                CSSStyleDeclaration computedStyle = 
viewCSS.getComputedStyle(element,
                                null);
                SVGPaint svgPaint = (SVGPaint) computedStyle
                                
.getPropertyCSSValue(SVGConstants.SVG_FILL_ATTRIBUTE);
                Color color = null;
                if (svgPaint.getPaintType() == SVGPaint.SVG_PAINTTYPE_RGBCOLOR) 
{
                        RGBColor rgb = svgPaint.getRGBColor();
                        float r = 
rgb.getRed().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
                        float g = rgb.getGreen()
                                        
.getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
                        float b = 
rgb.getBlue().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
                        color = new Color(r / 255, g / 255, b / 255);
                }
                
                return color;
        }

It doesn't compile yet, but it's probably close isn't it?

Vincent
-- 
View this message in context: 
http://www.nabble.com/JSVGCanvas-background-tf2239369.html#a6256717
Sent from the Batik - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to