Skip to content

Instantly share code, notes, and snippets.

@brunodles
Last active December 13, 2016 00:58
Show Gist options
  • Save brunodles/cc22bdd30b425aed215635a73ef911f7 to your computer and use it in GitHub Desktop.
Save brunodles/cc22bdd30b425aed215635a73ef911f7 to your computer and use it in GitHub Desktop.
<resources>
<color name="red50">#ffebee</color>
<color name="red100">#ffcdd2</color>
<color name="red200">#ef9a9a</color>
<color name="red300">#e57373</color>
<color name="red400">#ef5350</color>
<color name="red500">#f44336</color>
<color name="red600">#e53935</color>
<color name="red700">#d32f2f</color>
<color name="red800">#c62828</color>
<color name="red900">#b71c1c</color>
<color name="reda100">#ff8a80</color>
<color name="reda200">#ff5252</color>
<color name="reda400">#ff1744</color>
<color name="reda700">#d50000</color>
<color name="pink50">#fce4ec</color>
<color name="pink100">#f8bbd0</color>
<color name="pink200">#f48fb1</color>
<color name="pink300">#f06292</color>
<color name="pink400">#ec407a</color>
<color name="pink500">#e91e63</color>
<color name="pink600">#d81b60</color>
<color name="pink700">#c2185b</color>
<color name="pink800">#ad1457</color>
<color name="pink900">#880e4f</color>
<color name="pinka100">#ff80ab</color>
<color name="pinka200">#ff4081</color>
<color name="pinka400">#f50057</color>
<color name="pinka700">#c51162</color>
<color name="purple50">#f3e5f5</color>
<color name="purple100">#e1bee7</color>
<color name="purple200">#ce93d8</color>
<color name="purple300">#ba68c8</color>
<color name="purple400">#ab47bc</color>
<color name="purple500">#9c27b0</color>
<color name="purple600">#8e24aa</color>
<color name="purple700">#7b1fa2</color>
<color name="purple800">#6a1b9a</color>
<color name="purple900">#4a148c</color>
<color name="purplea100">#ea80fc</color>
<color name="purplea200">#e040fb</color>
<color name="purplea400">#d500f9</color>
<color name="purplea700">#aa00ff</color>
<color name="deep_purple50">#ede7f6</color>
<color name="deep_purple100">#d1c4e9</color>
<color name="deep_purple200">#b39ddb</color>
<color name="deep_purple300">#9575cd</color>
<color name="deep_purple400">#7e57c2</color>
<color name="deep_purple500">#673ab7</color>
<color name="deep_purple600">#5e35b1</color>
<color name="deep_purple700">#512da8</color>
<color name="deep_purple800">#4527a0</color>
<color name="deep_purple900">#311b92</color>
<color name="deep_purplea100">#b388ff</color>
<color name="deep_purplea200">#7c4dff</color>
<color name="deep_purplea400">#651fff</color>
<color name="deep_purplea700">#6200ea</color>
<color name="indigo50">#e8eaf6</color>
<color name="indigo100">#c5cae9</color>
<color name="indigo200">#9fa8da</color>
<color name="indigo300">#7986cb</color>
<color name="indigo400">#5c6bc0</color>
<color name="indigo500">#3f51b5</color>
<color name="indigo600">#3949ab</color>
<color name="indigo700">#303f9f</color>
<color name="indigo800">#283593</color>
<color name="indigo900">#1a237e</color>
<color name="indigoa100">#8c9eff</color>
<color name="indigoa200">#536dfe</color>
<color name="indigoa400">#3d5afe</color>
<color name="indigoa700">#304ffe</color>
<color name="blue50">#e3f2fd</color>
<color name="blue100">#bbdefb</color>
<color name="blue200">#90caf9</color>
<color name="blue300">#64b5f6</color>
<color name="blue400">#42a5f5</color>
<color name="blue500">#2196f3</color>
<color name="blue600">#1e88e5</color>
<color name="blue700">#1976d2</color>
<color name="blue800">#1565c0</color>
<color name="blue900">#0d47a1</color>
<color name="bluea100">#82b1ff</color>
<color name="bluea200">#448aff</color>
<color name="bluea400">#2979ff</color>
<color name="bluea700">#2962ff</color>
<color name="light_blue50">#e1f5fe</color>
<color name="light_blue100">#b3e5fc</color>
<color name="light_blue200">#81d4fa</color>
<color name="light_blue300">#4fc3f7</color>
<color name="light_blue400">#29b6f6</color>
<color name="light_blue500">#03a9f4</color>
<color name="light_blue600">#039be5</color>
<color name="light_blue700">#0288d1</color>
<color name="light_blue800">#0277bd</color>
<color name="light_blue900">#01579b</color>
<color name="light_bluea100">#80d8ff</color>
<color name="light_bluea200">#40c4ff</color>
<color name="light_bluea400">#00b0ff</color>
<color name="light_bluea700">#0091ea</color>
<color name="cyan50">#e0f7fa</color>
<color name="cyan100">#b2ebf2</color>
<color name="cyan200">#80deea</color>
<color name="cyan300">#4dd0e1</color>
<color name="cyan400">#26c6da</color>
<color name="cyan500">#00bcd4</color>
<color name="cyan600">#00acc1</color>
<color name="cyan700">#0097a7</color>
<color name="cyan800">#00838f</color>
<color name="cyan900">#006064</color>
<color name="cyana100">#84ffff</color>
<color name="cyana200">#18ffff</color>
<color name="cyana400">#00e5ff</color>
<color name="cyana700">#00b8d4</color>
<color name="teal50">#e0f2f1</color>
<color name="teal100">#b2dfdb</color>
<color name="teal200">#80cbc4</color>
<color name="teal300">#4db6ac</color>
<color name="teal400">#26a69a</color>
<color name="teal500">#009688</color>
<color name="teal600">#00897b</color>
<color name="teal700">#00796b</color>
<color name="teal800">#00695c</color>
<color name="teal900">#004d40</color>
<color name="teala100">#a7ffeb</color>
<color name="teala200">#64ffda</color>
<color name="teala400">#1de9b6</color>
<color name="teala700">#00bfa5</color>
<color name="green50">#e8f5e9</color>
<color name="green100">#c8e6c9</color>
<color name="green200">#a5d6a7</color>
<color name="green300">#81c784</color>
<color name="green400">#66bb6a</color>
<color name="green500">#4caf50</color>
<color name="green600">#43a047</color>
<color name="green700">#388e3c</color>
<color name="green800">#2e7d32</color>
<color name="green900">#1b5e20</color>
<color name="greena100">#b9f6ca</color>
<color name="greena200">#69f0ae</color>
<color name="greena400">#00e676</color>
<color name="greena700">#00c853</color>
<color name="light_green50">#f1f8e9</color>
<color name="light_green100">#dcedc8</color>
<color name="light_green200">#c5e1a5</color>
<color name="light_green300">#aed581</color>
<color name="light_green400">#9ccc65</color>
<color name="light_green500">#8bc34a</color>
<color name="light_green600">#7cb342</color>
<color name="light_green700">#689f38</color>
<color name="light_green800">#558b2f</color>
<color name="light_green900">#33691e</color>
<color name="light_greena100">#ccff90</color>
<color name="light_greena200">#b2ff59</color>
<color name="light_greena400">#76ff03</color>
<color name="light_greena700">#64dd17</color>
<color name="lime50">#f9fbe7</color>
<color name="lime100">#f0f4c3</color>
<color name="lime200">#e6ee9c</color>
<color name="lime300">#dce775</color>
<color name="lime400">#d4e157</color>
<color name="lime500">#cddc39</color>
<color name="lime600">#c0ca33</color>
<color name="lime700">#afb42b</color>
<color name="lime800">#9e9d24</color>
<color name="lime900">#827717</color>
<color name="limea100">#f4ff81</color>
<color name="limea200">#eeff41</color>
<color name="limea400">#c6ff00</color>
<color name="limea700">#aeea00</color>
<color name="yellow50">#fffde7</color>
<color name="yellow100">#fff9c4</color>
<color name="yellow200">#fff59d</color>
<color name="yellow300">#fff176</color>
<color name="yellow400">#ffee58</color>
<color name="yellow500">#ffeb3b</color>
<color name="yellow600">#fdd835</color>
<color name="yellow700">#fbc02d</color>
<color name="yellow800">#f9a825</color>
<color name="yellow900">#f57f17</color>
<color name="yellowa100">#ffff8d</color>
<color name="yellowa200">#ffff00</color>
<color name="yellowa400">#ffea00</color>
<color name="yellowa700">#ffd600</color>
<color name="amber50">#fff8e1</color>
<color name="amber100">#ffecb3</color>
<color name="amber200">#ffe082</color>
<color name="amber300">#ffd54f</color>
<color name="amber400">#ffca28</color>
<color name="amber500">#ffc107</color>
<color name="amber600">#ffb300</color>
<color name="amber700">#ffa000</color>
<color name="amber800">#ff8f00</color>
<color name="amber900">#ff6f00</color>
<color name="ambera100">#ffe57f</color>
<color name="ambera200">#ffd740</color>
<color name="ambera400">#ffc400</color>
<color name="ambera700">#ffab00</color>
<color name="orange50">#fff3e0</color>
<color name="orange100">#ffe0b2</color>
<color name="orange200">#ffcc80</color>
<color name="orange300">#ffb74d</color>
<color name="orange400">#ffa726</color>
<color name="orange500">#ff9800</color>
<color name="orange600">#fb8c00</color>
<color name="orange700">#f57c00</color>
<color name="orange800">#ef6c00</color>
<color name="orange900">#e65100</color>
<color name="orangea100">#ffd180</color>
<color name="orangea200">#ffab40</color>
<color name="orangea400">#ff9100</color>
<color name="orangea700">#ff6d00</color>
<color name="deep_orange50">#fbe9e7</color>
<color name="deep_orange100">#ffccbc</color>
<color name="deep_orange200">#ffab91</color>
<color name="deep_orange300">#ff8a65</color>
<color name="deep_orange400">#ff7043</color>
<color name="deep_orange500">#ff5722</color>
<color name="deep_orange600">#f4511e</color>
<color name="deep_orange700">#e64a19</color>
<color name="deep_orange800">#d84315</color>
<color name="deep_orange900">#bf360c</color>
<color name="deep_orangea100">#ff9e80</color>
<color name="deep_orangea200">#ff6e40</color>
<color name="deep_orangea400">#ff3d00</color>
<color name="deep_orangea700">#dd2c00</color>
<color name="brown50">#efebe9</color>
<color name="brown100">#d7ccc8</color>
<color name="brown200">#bcaaa4</color>
<color name="brown300">#a1887f</color>
<color name="brown400">#8d6e63</color>
<color name="brown500">#795548</color>
<color name="brown600">#6d4c41</color>
<color name="brown700">#5d4037</color>
<color name="brown800">#4e342e</color>
<color name="brown900">#3e2723</color>
<color name="grey50">#fafafa</color>
<color name="grey100">#f5f5f5</color>
<color name="grey200">#eeeeee</color>
<color name="grey300">#e0e0e0</color>
<color name="grey400">#bdbdbd</color>
<color name="grey500">#9e9e9e</color>
<color name="grey600">#757575</color>
<color name="grey700">#616161</color>
<color name="grey800">#424242</color>
<color name="grey900">#212121</color>
<color name="blue_grey50">#eceff1</color>
<color name="blue_grey100">#cfd8dc</color>
<color name="blue_grey200">#b0bec5</color>
<color name="blue_grey300">#90a4ae</color>
<color name="blue_grey400">#78909c</color>
<color name="blue_grey500">#607d8b</color>
<color name="blue_grey600">#546e7a</color>
<color name="blue_grey700">#455a64</color>
<color name="blue_grey800">#37474f</color>
<color name="blue_grey900">#263238</color>
<color name="black">#000000</color>
<color name="white">#ffffff</color>
</resources>
function toCamel(value) {
return value.replace(' ', '_').toLowerCase();
};
var views = $$('li.color');
var result = "<resources>\n";
var lastName = "";
for (i in views) {
var colorItem = views[i];
if ($('span.name', colorItem) !== null) continue;
var name = "";
var nameElement = $('span.name', colorItem.parentElement);
var shade = $('.shade', colorItem).textContent;
var hex = $('.hex', colorItem).textContent;
if (nameElement !== undefined && nameElement !== null)
name = nameElement.textContent;
//console.log(i+" "+name+shade+" "+hex);
if (lastName != name){
result+="\n";
lastName = name;
}
result += " <color name=\""+toCamel(name+shade)+"\">"+hex+"</color>\n";
}
result += "</resources>";
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment