Web colors in an Android color XML resource file
What do all of the X11/w3c color codes look like in the format of an Android XML resource file?
I know this looks a tad ridiculous as a question, but given the votes apparently it's useful and since it clearly does not require an off-site resource I'm reformatting it to keep it around. --Editor.
You have surely made your own by now, but for the benefit of others, please find w3c and x11 below.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#FFFFFF</color>
<color name="yellow">#FFFF00</color>
<color name="fuchsia">#FF00FF</color>
<color name="red">#FF0000</color>
<color name="silver">#C0C0C0</color>
<color name="gray">#808080</color>
<color name="olive">#808000</color>
<color name="purple">#800080</color>
<color name="maroon">#800000</color>
<color name="aqua">#00FFFF</color>
<color name="lime">#00FF00</color>
<color name="teal">#008080</color>
<color name="green">#008000</color>
<color name="blue">#0000FF</color>
<color name="navy">#000080</color>
<color name="black">#000000</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="White">#FFFFFF</color>
<color name="Ivory">#FFFFF0</color>
<color name="LightYellow">#FFFFE0</color>
<color name="Yellow">#FFFF00</color>
<color name="Snow">#FFFAFA</color>
<color name="FloralWhite">#FFFAF0</color>
<color name="LemonChiffon">#FFFACD</color>
<color name="Cornsilk">#FFF8DC</color>
<color name="Seashell">#FFF5EE</color>
<color name="LavenderBlush">#FFF0F5</color>
<color name="PapayaWhip">#FFEFD5</color>
<color name="BlanchedAlmond">#FFEBCD</color>
<color name="MistyRose">#FFE4E1</color>
<color name="Bisque">#FFE4C4</color>
<color name="Moccasin">#FFE4B5</color>
<color name="NavajoWhite">#FFDEAD</color>
<color name="PeachPuff">#FFDAB9</color>
<color name="Gold">#FFD700</color>
<color name="Pink">#FFC0CB</color>
<color name="LightPink">#FFB6C1</color>
<color name="Orange">#FFA500</color>
<color name="LightSalmon">#FFA07A</color>
<color name="DarkOrange">#FF8C00</color>
<color name="Coral">#FF7F50</color>
<color name="HotPink">#FF69B4</color>
<color name="Tomato">#FF6347</color>
<color name="OrangeRed">#FF4500</color>
<color name="DeepPink">#FF1493</color>
<color name="Fuchsia">#FF00FF</color>
<color name="Magenta">#FF00FF</color>
<color name="Red">#FF0000</color>
<color name="OldLace">#FDF5E6</color>
<color name="LightGoldenrodYellow">#FAFAD2</color>
<color name="Linen">#FAF0E6</color>
<color name="AntiqueWhite">#FAEBD7</color>
<color name="Salmon">#FA8072</color>
<color name="GhostWhite">#F8F8FF</color>
<color name="MintCream">#F5FFFA</color>
<color name="WhiteSmoke">#F5F5F5</color>
<color name="Beige">#F5F5DC</color>
<color name="Wheat">#F5DEB3</color>
<color name="SandyBrown">#F4A460</color>
<color name="Azure">#F0FFFF</color>
<color name="Honeydew">#F0FFF0</color>
<color name="AliceBlue">#F0F8FF</color>
<color name="Khaki">#F0E68C</color>
<color name="LightCoral">#F08080</color>
<color name="PaleGoldenrod">#EEE8AA</color>
<color name="Violet">#EE82EE</color>
<color name="DarkSalmon">#E9967A</color>
<color name="Lavender">#E6E6FA</color>
<color name="LightCyan">#E0FFFF</color>
<color name="BurlyWood">#DEB887</color>
<color name="Plum">#DDA0DD</color>
<color name="Gainsboro">#DCDCDC</color>
<color name="Crimson">#DC143C</color>
<color name="PaleVioletRed">#DB7093</color>
<color name="Goldenrod">#DAA520</color>
<color name="Orchid">#DA70D6</color>
<color name="Thistle">#D8BFD8</color>
<color name="LightGrey">#D3D3D3</color>
<color name="Tan">#D2B48C</color>
<color name="Chocolate">#D2691E</color>
<color name="Peru">#CD853F</color>
<color name="IndianRed">#CD5C5C</color>
<color name="MediumVioletRed">#C71585</color>
<color name="Silver">#C0C0C0</color>
<color name="DarkKhaki">#BDB76B</color>
<color name="RosyBrown">#BC8F8F</color>
<color name="MediumOrchid">#BA55D3</color>
<color name="DarkGoldenrod">#B8860B</color>
<color name="FireBrick">#B22222</color>
<color name="PowderBlue">#B0E0E6</color>
<color name="LightSteelBlue">#B0C4DE</color>
<color name="PaleTurquoise">#AFEEEE</color>
<color name="GreenYellow">#ADFF2F</color>
<color name="LightBlue">#ADD8E6</color>
<color name="DarkGray">#A9A9A9</color>
<color name="Brown">#A52A2A</color>
<color name="Sienna">#A0522D</color>
<color name="YellowGreen">#9ACD32</color>
<color name="DarkOrchid">#9932CC</color>
<color name="PaleGreen">#98FB98</color>
<color name="DarkViolet">#9400D3</color>
<color name="MediumPurple">#9370DB</color>
<color name="LightGreen">#90EE90</color>
<color name="DarkSeaGreen">#8FBC8F</color>
<color name="SaddleBrown">#8B4513</color>
<color name="DarkMagenta">#8B008B</color>
<color name="DarkRed">#8B0000</color>
<color name="BlueViolet">#8A2BE2</color>
<color name="LightSkyBlue">#87CEFA</color>
<color name="SkyBlue">#87CEEB</color>
<color name="Gray">#808080</color>
<color name="Olive">#808000</color>
<color name="Purple">#800080</color>
<color name="Maroon">#800000</color>
<color name="Aquamarine">#7FFFD4</color>
<color name="Chartreuse">#7FFF00</color>
<color name="LawnGreen">#7CFC00</color>
<color name="MediumSlateBlue">#7B68EE</color>
<color name="LightSlateGray">#778899</color>
<color name="SlateGray">#708090</color>
<color name="OliveDrab">#6B8E23</color>
<color name="SlateBlue">#6A5ACD</color>
<color name="DimGray">#696969</color>
<color name="MediumAquamarine">#66CDAA</color>
<color name="CornflowerBlue">#6495ED</color>
<color name="CadetBlue">#5F9EA0</color>
<color name="DarkOliveGreen">#556B2F</color>
<color name="Indigo">#4B0082</color>
<color name="MediumTurquoise">#48D1CC</color>
<color name="DarkSlateBlue">#483D8B</color>
<color name="SteelBlue">#4682B4</color>
<color name="RoyalBlue">#4169E1</color>
<color name="Turquoise">#40E0D0</color>
<color name="MediumSeaGreen">#3CB371</color>
<color name="LimeGreen">#32CD32</color>
<color name="DarkSlateGray">#2F4F4F</color>
<color name="SeaGreen">#2E8B57</color>
<color name="ForestGreen">#228B22</color>
<color name="LightSeaGreen">#20B2AA</color>
<color name="DodgerBlue">#1E90FF</color>
<color name="MidnightBlue">#191970</color>
<color name="Aqua">#00FFFF</color>
<color name="Cyan">#00FFFF</color>
<color name="SpringGreen">#00FF7F</color>
<color name="Lime">#00FF00</color>
<color name="MediumSpringGreen">#00FA9A</color>
<color name="DarkTurquoise">#00CED1</color>
<color name="DeepSkyBlue">#00BFFF</color>
<color name="DarkCyan">#008B8B</color>
<color name="Teal">#008080</color>
<color name="Green">#008000</color>
<color name="DarkGreen">#006400</color>
<color name="Blue">#0000FF</color>
<color name="MediumBlue">#0000CD</color>
<color name="DarkBlue">#00008B</color>
<color name="Navy">#000080</color>
<color name="Black">#000000</color>
</resources>
You have to create the colors.xml
file in the res/values
folder of your project. The code of colors.xml
is
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="orange">#ff5500</color>
<color name="white">#ffffff</color>
<color name="transparent">#00000000</color>
<color name="date_color">#999999</color>
<color name="black">#000000</color>
<color name="gray">#999999</color>
<color name="blue">#0066cc</color>
<color name="gold">#e6b121</color>
<color name="blueback">#99FFFF</color>
<color name="articlecolor">#3399FF</color>
<color name="article_title">#3399FF</color>
<color name="cachecolor">#8ad0e8</color>
</resources>
Or, you can use Colors in your application by following way
android.graphics.Color.TRANSPARENT;
Similarly
android.graphics.Color.RED;
I change all code to lower case for mono android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#FFFFFF</color>
<color name="ivory">#FFFFF0</color>
<color name="lightyellow">#FFFFE0</color>
<color name="yellow">#FFFF00</color>
<color name="snow">#FFFAFA</color>
<color name="floralwhite">#FFFAF0</color>
<color name="lemonchiffon">#FFFACD</color>
<color name="cornsilk">#FFF8DC</color>
<color name="seashell">#FFF5EE</color>
<color name="lavenderblush">#FFF0F5</color>
<color name="papayawhip">#FFEFD5</color>
<color name="blanchedalmond">#FFEBCD</color>
<color name="mistyrose">#FFE4E1</color>
<color name="bisque">#FFE4C4</color>
<color name="moccasin">#FFE4B5</color>
<color name="navajowhite">#FFDEAD</color>
<color name="peachpuff">#FFDAB9</color>
<color name="gold">#FFD700</color>
<color name="pink">#FFC0CB</color>
<color name="lightpink">#FFB6C1</color>
<color name="orange">#FFA500</color>
<color name="lightsalmon">#FFA07A</color>
<color name="darkorange">#FF8C00</color>
<color name="coral">#FF7F50</color>
<color name="hotpink">#FF69B4</color>
<color name="tomato">#FF6347</color>
<color name="orangered">#FF4500</color>
<color name="deeppink">#FF1493</color>
<color name="fuchsia">#FF00FF</color>
<color name="magenta">#FF00FF</color>
<color name="red">#FF0000</color>
<color name="oldlace">#FDF5E6</color>
<color name="lightgoldenrodyellow">#FAFAD2</color>
<color name="linen">#FAF0E6</color>
<color name="antiquewhite">#FAEBD7</color>
<color name="salmon">#FA8072</color>
<color name="ghostwhite">#F8F8FF</color>
<color name="mintcream">#F5FFFA</color>
<color name="whitesmoke">#F5F5F5</color>
<color name="beige">#F5F5DC</color>
<color name="wheat">#F5DEB3</color>
<color name="sandybrown">#F4A460</color>
<color name="azure">#F0FFFF</color>
<color name="honeydew">#F0FFF0</color>
<color name="aliceblue">#F0F8FF</color>
<color name="khaki">#F0E68C</color>
<color name="lightcoral">#F08080</color>
<color name="palegoldenrod">#EEE8AA</color>
<color name="violet">#EE82EE</color>
<color name="darksalmon">#E9967A</color>
<color name="lavender">#E6E6FA</color>
<color name="lightcyan">#E0FFFF</color>
<color name="burlywood">#DEB887</color>
<color name="plum">#DDA0DD</color>
<color name="gainsboro">#DCDCDC</color>
<color name="crimson">#DC143C</color>
<color name="palevioletred">#DB7093</color>
<color name="goldenrod">#DAA520</color>
<color name="orchid">#DA70D6</color>
<color name="thistle">#D8BFD8</color>
<color name="lightgrey">#D3D3D3</color>
<color name="tan">#D2B48C</color>
<color name="chocolate">#D2691E</color>
<color name="peru">#CD853F</color>
<color name="indianred">#CD5C5C</color>
<color name="mediumvioletred">#C71585</color>
<color name="silver">#C0C0C0</color>
<color name="darkkhaki">#BDB76B</color>
<color name="rosybrown">#BC8F8F</color>
<color name="mediumorchid">#BA55D3</color>
<color name="darkgoldenrod">#B8860B</color>
<color name="firebrick">#B22222</color>
<color name="powderblue">#B0E0E6</color>
<color name="lightsteelblue">#B0C4DE</color>
<color name="paleturquoise">#AFEEEE</color>
<color name="greenyellow">#ADFF2F</color>
<color name="lightblue">#ADD8E6</color>
<color name="darkgray">#A9A9A9</color>
<color name="brown">#A52A2A</color>
<color name="sienna">#A0522D</color>
<color name="yellowgreen">#9ACD32</color>
<color name="darkorchid">#9932CC</color>
<color name="palegreen">#98FB98</color>
<color name="darkviolet">#9400D3</color>
<color name="mediumpurple">#9370DB</color>
<color name="lightgreen">#90EE90</color>
<color name="darkseagreen">#8FBC8F</color>
<color name="saddlebrown">#8B4513</color>
<color name="darkmagenta">#8B008B</color>
<color name="darkred">#8B0000</color>
<color name="blueviolet">#8A2BE2</color>
<color name="lightskyblue">#87CEFA</color>
<color name="skyblue">#87CEEB</color>
<color name="gray">#808080</color>
<color name="olive">#808000</color>
<color name="purple">#800080</color>
<color name="maroon">#800000</color>
<color name="aquamarine">#7FFFD4</color>
<color name="chartreuse">#7FFF00</color>
<color name="lawngreen">#7CFC00</color>
<color name="mediumslateblue">#7B68EE</color>
<color name="lightslategray">#778899</color>
<color name="slategray">#708090</color>
<color name="olivedrab">#6B8E23</color>
<color name="slateblue">#6A5ACD</color>
<color name="dimgray">#696969</color>
<color name="mediumaquamarine">#66CDAA</color>
<color name="cornflowerblue">#6495ED</color>
<color name="cadetblue">#5F9EA0</color>
<color name="darkolivegreen">#556B2F</color>
<color name="indigo">#4B0082</color>
<color name="mediumturquoise">#48D1CC</color>
<color name="darkslateblue">#483D8B</color>
<color name="steelblue">#4682B4</color>
<color name="royalblue">#4169E1</color>
<color name="turquoise">#40E0D0</color>
<color name="mediumseagreen">#3CB371</color>
<color name="limegreen">#32CD32</color>
<color name="darkslategray">#2F4F4F</color>
<color name="seagreen">#2E8B57</color>
<color name="forestgreen">#228B22</color>
<color name="lightseagreen">#20B2AA</color>
<color name="dodgerblue">#1E90FF</color>
<color name="midnightblue">#191970</color>
<color name="aqua">#00FFFF</color>
<color name="cyan">#00FFFF</color>
<color name="springgreen">#00FF7F</color>
<color name="lime">#00FF00</color>
<color name="mediumspringgreen">#00FA9A</color>
<color name="darkturquoise">#00CED1</color>
<color name="deepskyblue">#00BFFF</color>
<color name="darkcyan">#008B8B</color>
<color name="teal">#008080</color>
<color name="green">#008000</color>
<color name="darkgreen">#006400</color>
<color name="blue">#0000FF</color>
<color name="mediumblue">#0000CD</color>
<color name="darkblue">#00008B</color>
<color name="navy">#000080</color>
<color name="black">#000000</color>
</resources>
If you are just looking for the available colors that already exist with
@android:color/<color>
then you need to look in android.jar >> android >> R.class >> R >> color
.
Here is the list that come with Android 4.4W I'm using:
background_dark
background_light
black
darker_gray
holo_blue_bright
holo_blue_dark
holo_blue_light
holo_green_dark
holo_green_light
holo_orange_dark
holo_orange_light
holo_purple
holo_red_dark
holo_red_light
primary_text_dark
primary_text_dark_nodisable
primary_text_light
primary_text_lignt_nodisable
secondary_text_dark
secondary_text_dark_nodisable
secondaryy_text_light
secondary_text_lignt_nodisable
tab_indicator_text
tertiary_text_dark
tertiary_text_light
transparent
white
widget_edittext_dark