Some interesting source code from Android 1.5 🤨
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
if (f.mColor != null) { Â int c = -1; Â if (f.mColor.equalsIgnoreCase("aqua")) { Â Â Â c = 0x00FFFF; Â } else if (f.mColor.equalsIgnoreCase("black")) { Â Â Â c = 0x000000; Â } else if (f.mColor.equalsIgnoreCase("blue")) { Â Â Â c = 0x0000FF; Â } else if (f.mColor.equalsIgnoreCase("fuchsia")) { Â Â Â c = 0xFF00FF; Â } else if (f.mColor.equalsIgnoreCase("green")) { Â Â Â c = 0x008000; Â } else if (f.mColor.equalsIgnoreCase("grey")) { Â Â Â c = 0x808080; Â } else if (f.mColor.equalsIgnoreCase("lime")) { Â Â Â c = 0x00FF00; Â } else if (f.mColor.equalsIgnoreCase("maroon")) { Â Â Â c = 0x800000; Â } else if (f.mColor.equalsIgnoreCase("navy")) { Â Â Â c = 0x000080; Â } else if (f.mColor.equalsIgnoreCase("olive")) { Â Â Â c = 0x808000; Â } else if (f.mColor.equalsIgnoreCase("purple")) { Â Â Â c = 0x800080; Â } else if (f.mColor.equalsIgnoreCase("red")) { Â Â Â c = 0xFF0000; Â } else if (f.mColor.equalsIgnoreCase("silver")) { Â Â Â c = 0xC0C0C0; Â } else if (f.mColor.equalsIgnoreCase("teal")) { Â Â Â c = 0x008080; Â } else if (f.mColor.equalsIgnoreCase("white")) { Â Â Â c = 0xFFFFFF; Â } else if (f.mColor.equalsIgnoreCase("yellow")) { Â Â Â c = 0xFFFF00; Â } else { Â Â Â try { Â Â Â Â Â c = XmlUtils.convertValueToInt(f.mColor, -1); Â Â Â } catch (NumberFormatException nfe) { Â Â Â Â Â // Can't understand the color, so just drop it. Â Â Â } Â } |