/src/com/larvalabs/svgandroid/SVGColors.java

https://code.google.com/ · Java · 176 lines · 157 code · 5 blank · 14 comment · 0 complexity · 71f9dcdcc98ff00a5379506ee99c6220 MD5 · raw file

  1. /*Copyright 2010-2011 Google Inc.
  2. *
  3. *Licensed under the Apache License, Version 2.0 (the "License");
  4. *you may not use this file except in compliance with the License.
  5. *You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. *Unless required by applicable law or agreed to in writing, software
  10. *distributed under the License is distributed on an "AS IS" BASIS,
  11. *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. *See the License for the specific language governing permissions and
  13. *limitations under the License.
  14. */
  15. package com.larvalabs.svgandroid;
  16. import java.util.HashMap;
  17. public class SVGColors {
  18. private static HashMap<String, Integer> colors = new HashMap<String, Integer>();
  19. public static Integer mapColor(String color) {
  20. return colors.get(color);
  21. }
  22. static {
  23. colors.put("aliceblue", 0xf0f8ff);
  24. colors.put("antiquewhite", 0xfaebd7);
  25. colors.put("aqua", 0x00ffff);
  26. colors.put("aquamarine", 0x7fffd4);
  27. colors.put("azure", 0xf0ffff);
  28. colors.put("beige", 0xf5f5dc);
  29. colors.put("bisque", 0xffe4c4);
  30. colors.put("black", 0x000000);
  31. colors.put("blanchedalmond", 0xffebcd);
  32. colors.put("blue", 0x0000ff);
  33. colors.put("blueviolet", 0x8a2be2);
  34. colors.put("brown", 0xa52a2a);
  35. colors.put("burlywood", 0xdeb887);
  36. colors.put("cadetblue", 0x5f9ea0);
  37. colors.put("chartreuse", 0x7fff00);
  38. colors.put("chocolate", 0xd2691e);
  39. colors.put("coral", 0xff7f50);
  40. colors.put("cornflowerblue", 0x6495ed);
  41. colors.put("cornsilk", 0xfff8dc);
  42. colors.put("crimson", 0xdc143c);
  43. colors.put("cyan", 0x00ffff);
  44. colors.put("darkblue", 0x00008b);
  45. colors.put("darkcyan", 0x008b8b);
  46. colors.put("darkgoldenrod", 0xb8860b);
  47. colors.put("darkgray", 0xa9a9a9);
  48. colors.put("darkgreen", 0x006400);
  49. colors.put("darkgrey", 0xa9a9a9);
  50. colors.put("darkkhaki", 0xbdb76b);
  51. colors.put("darkmagenta", 0x8b008b);
  52. colors.put("darkolivegreen", 0x556b2f);
  53. colors.put("darkorange", 0xff8c00);
  54. colors.put("darkorchid", 0x9932cc);
  55. colors.put("darkred", 0x8b0000);
  56. colors.put("darksalmon", 0xe9967a);
  57. colors.put("darkseagreen", 0x8fbc8f);
  58. colors.put("darkslateblue", 0x483d8b);
  59. colors.put("darkslategray", 0x2f4f4f);
  60. colors.put("darkslategrey", 0x2f4f4f);
  61. colors.put("darkturquoise", 0x00ced1);
  62. colors.put("darkviolet", 0x9400d3);
  63. colors.put("deeppink", 0xff1493);
  64. colors.put("deepskyblue", 0x00bfff);
  65. colors.put("dimgray", 0x696969);
  66. colors.put("dimgrey", 0x696969);
  67. colors.put("dodgerblue", 0x1e90ff);
  68. colors.put("firebrick", 0xb22222);
  69. colors.put("floralwhite", 0xfffaf0);
  70. colors.put("forestgreen", 0x228b22);
  71. colors.put("fuchsia", 0xff00ff);
  72. colors.put("gainsboro", 0xdcdcdc);
  73. colors.put("ghostwhite", 0xf8f8ff);
  74. colors.put("gold", 0xffd700);
  75. colors.put("goldenrod", 0xdaa520);
  76. colors.put("gray", 0x808080);
  77. colors.put("green", 0x008000);
  78. colors.put("greenyellow", 0xadff2f);
  79. colors.put("grey", 0x808080);
  80. colors.put("honeydew", 0xf0fff0);
  81. colors.put("hotpink", 0xff69b4);
  82. colors.put("indianred", 0xcd5c5c);
  83. colors.put("indigo", 0x4b0082);
  84. colors.put("ivory", 0xfffff0);
  85. colors.put("khaki", 0xf0e68c);
  86. colors.put("lavender", 0xe6e6fa);
  87. colors.put("lavenderblush", 0xfff0f5);
  88. colors.put("lawngreen", 0x7cfc00);
  89. colors.put("lemonchiffon", 0xfffacd);
  90. colors.put("lightblue", 0xadd8e6);
  91. colors.put("lightcoral", 0xf08080);
  92. colors.put("lightcyan", 0xe0ffff);
  93. colors.put("lightgoldenrodyellow", 0xfafad2);
  94. colors.put("lightgray", 0xd3d3d3);
  95. colors.put("lightgreen", 0x90ee90);
  96. colors.put("lightgrey", 0xd3d3d3);
  97. colors.put("lightpink", 0xffb6c1);
  98. colors.put("lightsalmon", 0xffa07a);
  99. colors.put("lightseagreen", 0x20b2aa);
  100. colors.put("lightskyblue", 0x87cefa);
  101. colors.put("lightslategray", 0x778899);
  102. colors.put("lightslategrey", 0x778899);
  103. colors.put("lightsteelblue", 0xb0c4de);
  104. colors.put("lightyellow", 0xffffe0);
  105. colors.put("lime", 0x00ff00);
  106. colors.put("limegreen", 0x32cd32);
  107. colors.put("linen", 0xfaf0e6);
  108. colors.put("magenta", 0xff00ff);
  109. colors.put("maroon", 0x800000);
  110. colors.put("mediumaquamarine", 0x66cdaa);
  111. colors.put("mediumblue", 0x0000cd);
  112. colors.put("mediumorchid", 0xba55d3);
  113. colors.put("mediumpurple", 0x9370db);
  114. colors.put("mediumseagreen", 0x3cb371);
  115. colors.put("mediumslateblue", 0x7b68ee);
  116. colors.put("mediumspringgreen", 0x00fa9a);
  117. colors.put("mediumturquoise", 0x48d1cc);
  118. colors.put("mediumvioletred", 0xc71585);
  119. colors.put("midnightblue", 0x191970);
  120. colors.put("mintcream", 0xf5fffa);
  121. colors.put("mistyrose", 0xffe4e1);
  122. colors.put("moccasin", 0xffe4b5);
  123. colors.put("navajowhite", 0xffdead);
  124. colors.put("navy", 0x000080);
  125. colors.put("oldlace", 0xfdf5e6);
  126. colors.put("olive", 0x808000);
  127. colors.put("olivedrab", 0x6b8e23);
  128. colors.put("orange", 0xffa500);
  129. colors.put("orangered", 0xff4500);
  130. colors.put("orchid", 0xda70d6);
  131. colors.put("palegoldenrod", 0xeee8aa);
  132. colors.put("palegreen", 0x98fb98);
  133. colors.put("paleturquoise", 0xafeeee);
  134. colors.put("palevioletred", 0xdb7093);
  135. colors.put("papayawhip", 0xffefd5);
  136. colors.put("peachpuff", 0xffdab9);
  137. colors.put("peru", 0xcd853f);
  138. colors.put("pink", 0xffc0cb);
  139. colors.put("plum", 0xdda0dd);
  140. colors.put("powderblue", 0xb0e0e6);
  141. colors.put("purple", 0x800080);
  142. colors.put("red", 0xff0000);
  143. colors.put("rosybrown", 0xbc8f8f);
  144. colors.put("royalblue", 0x4169e1);
  145. colors.put("saddlebrown", 0x8b4513);
  146. colors.put("salmon", 0xfa8072);
  147. colors.put("sandybrown", 0xf4a460);
  148. colors.put("seagreen", 0x2e8b57);
  149. colors.put("seashell", 0xfff5ee);
  150. colors.put("sienna", 0xa0522d);
  151. colors.put("silver", 0xc0c0c0);
  152. colors.put("skyblue", 0x87ceeb);
  153. colors.put("slateblue", 0x6a5acd);
  154. colors.put("slategray", 0x708090);
  155. colors.put("slategrey", 0x708090);
  156. colors.put("snow", 0xfffafa);
  157. colors.put("springgreen", 0x00ff7f);
  158. colors.put("steelblue", 0x4682b4);
  159. colors.put("tan", 0xd2b48c);
  160. colors.put("teal", 0x008080);
  161. colors.put("thistle", 0xd8bfd8);
  162. colors.put("tomato", 0xff6347);
  163. colors.put("turquoise", 0x40e0d0);
  164. colors.put("violet", 0xee82ee);
  165. colors.put("wheat", 0xf5deb3);
  166. colors.put("white", 0xffffff);
  167. colors.put("whitesmoke", 0xf5f5f5);
  168. colors.put("yellow", 0xffff00);
  169. colors.put("yellowgreen", 0x9acd32);
  170. }
  171. }