Source:
private static org.eclipse.swt.graphics.RGB resolveThemeColor ( com.android.ide.common.resources.ResourceResolver resources , java.lang.String resourceName ) { com.android.ide.common.rendering.api.ResourceValue textColor = resources.findItemInTheme ( resourceName ) ; textColor = resources.resolveResValue ( textColor ) ; if ( textColor == null ) { return null ; } java.lang.String value = textColor.getValue ( ) ; while ( value != null ) { if ( value.startsWith ( "#" ) ) { try { int rgba = com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.getColor ( value ) ; return com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.intToRgb ( rgba ) ; } catch ( java.lang.NumberFormatException nfe ) { } return null ; } if ( value.startsWith ( "@" ) ) { boolean isFramework = textColor.isFramework ( ) ; textColor = resources.findResValue ( value , isFramework ) ; if ( textColor != null ) { value = textColor.getValue ( ) ; } else { break ; } } else { java.io.File file = new java.io.File ( value ) ; if ( ( file.exists ( ) ) && ( file.getName ( ) . endsWith ( com.android.ide.eclipse.adt.AndroidConstants.DOT_XML ) ) ) { javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) ; java.io.BufferedInputStream bis = null ; try { bis = new java.io.BufferedInputStream ( new java.io.FileInputStream ( file ) ) ; org.xml.sax.InputSource is = new org.xml.sax.InputSource ( bis ) ; factory.setNamespaceAware ( true ) ; factory.setValidating ( false ) ; javax.xml.parsers.DocumentBuilder builder = factory.newDocumentBuilder ( ) ; org.w3c.dom.Document document = builder.parse ( is ) ; org.w3c.dom.NodeList items = document.getElementsByTagName ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.TAG_ITEM ) ; value = com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.findColorValue ( items ) ; continue ; } catch ( java.lang.Exception e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , "Failed parsing color file %1$s" , file.getName ( ) ) ; } finally { if ( bis != null ) { try { bis.close ( ) ; } catch ( java.io.IOException e ) { } } } } return null ; } } return null ; }

Target:
private static org.eclipse.swt.graphics.RGB resolveThemeColor ( com.android.ide.common.resources.ResourceResolver resources , java.lang.String resourceName ) { com.android.ide.common.rendering.api.ResourceValue textColor = resources.findItemInTheme ( resourceName ) ; textColor = resources.resolveResValue ( textColor ) ; if ( textColor == null ) { return null ; } java.lang.String value = textColor.getValue ( ) ; while ( value != null ) { if ( value.startsWith ( "#" ) ) { try { int rgba = com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.getColor ( value ) ; return com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.intToRgb ( rgba ) ; } catch ( java.lang.NumberFormatException nfe ) { } return null ; } if ( value.startsWith ( "@" ) ) { boolean isFramework = textColor.isFramework ( ) ; textColor = resources.findResValue ( value , isFramework ) ; if ( textColor != null ) { value = textColor.getValue ( ) ; } else { break ; } } else { java.io.File file = new java.io.File ( value ) ; if ( ( file.exists ( ) ) && ( file.getName ( ) . endsWith ( com.android.ide.eclipse.adt.AdtConstants.DOT_XML ) ) ) { javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) ; java.io.BufferedInputStream bis = null ; try { bis = new java.io.BufferedInputStream ( new java.io.FileInputStream ( file ) ) ; org.xml.sax.InputSource is = new org.xml.sax.InputSource ( bis ) ; factory.setNamespaceAware ( true ) ; factory.setValidating ( false ) ; javax.xml.parsers.DocumentBuilder builder = factory.newDocumentBuilder ( ) ; org.w3c.dom.Document document = builder.parse ( is ) ; org.w3c.dom.NodeList items = document.getElementsByTagName ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.TAG_ITEM ) ; value = com.android.ide.eclipse.adt.internal.editors.layout.gle2.PreviewIconFactory.findColorValue ( items ) ; continue ; } catch ( java.lang.Exception e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , "Failed parsing color file %1$s" , file.getName ( ) ) ; } finally { if ( bis != null ) { try { bis.close ( ) ; } catch ( java.io.IOException e ) { } } } } return null ; } } return null ; }