public Color getAsColor ( String attribute ) { if ( ! isColor ( attribute ) ) { throw new RuntimeException ( "Attribute " + attribute + " is not specified as a color:" + getAttribute ( attribute ) ) ; } int col = Integer . parseInt ( getAttribute ( attribute ) . substring ( 1 ) , 16 ) ; return new Color ( col ) ; }
Get an attribute value converted to a color . isColor should first be checked