3

I want to use Holo colors for my app. For example, I'd like the divider horizontal bars to be the exact same light-gray as in other apps. I'm pretty sure there must be some place where these colors are defined as constants, so that the programmer does not have to input actual hex values. I have been reading through documentation but I haven't found it. Do you know where I can find such list of color names?

Luis Mendo
  • 110,752
  • 13
  • 76
  • 147

2 Answers2

4

Most of the colors can be found in the colors.xml file which can be found in

android-sdk-windows\platforms\android-18\data\res\values

Edit:

the list seperator you are asking about is actually a drawable, you can find the style here

<style name="Widget.Holo.Light.TextView.ListSeparator" parent="Widget.TextView.ListSeparator">
    <item name="android:background">@android:drawable/list_section_divider_holo_light</item>
    <item name="android:textAllCaps">true</item>
</style>

you can find that in the drawables folder

tyczj
  • 71,600
  • 54
  • 194
  • 296
  • Thanks. And is there a way to know their standard usage? For example: if I want to use the color of the horizontal divider lines seen in Gmail's settings screen, how do I know which is in this list? – Luis Mendo Aug 02 '13 at 19:12
  • Thanks. Still, that was just an example. I'd like to know the standard usage of each color. There has to be a description/recommended use somewhere? – Luis Mendo Aug 02 '13 at 19:26
  • what do you mean by standard usage? Like a list of every single color used? – tyczj Aug 02 '13 at 19:29
  • I mean: if you take the main screen of Gmail app for example. What is the almost-black color in the title? The slightly less dark color used in the sender's name for each message? The lighter gray used in the beginning words of the message that are shown right after sender's name? And so on. It's hard to relate those colors to the color names in the `color.xml` file – Luis Mendo Aug 02 '13 at 19:32
  • sorry I dont really know what you are referring to, can you show an image and maybe I can help – tyczj Aug 02 '13 at 19:35
  • See this image: https://www.google.es/search?q=Gmail+app&rlz=1C1SVEA_enES402ES402&source=lnms&tbm=isch&sa=X&ei=_An8UdvSF9Pe7AasyYCQDg&ved=0CAkQ_AUoAQ&biw=1366&bih=643#facrc=_&imgdii=_&imgrc=I7q7evA3JDlNzM%3A%3B4PwQDSkO__0nAM%3Bhttp%253A%252F%252Fwww.fastcodesign.com%252Fmultisite_files%252Fcodesign%252Fimagecache%252Finline-large%252Finline%252F2012%252F12%252F1671388-inline-inline-gmail-20-ios.jpg%3Bhttp%253A%252F%252Fwww.fastcodesign.com%252F1671388%252Fthe-ios-gmail-app-20-faster-and-far-more-beautiful%3B642%3B456 How to know which are the gray colors used there? – Luis Mendo Aug 02 '13 at 19:35
  • Ok, that one seems to be for iOS, but you get the idea – Luis Mendo Aug 02 '13 at 19:36
  • yeah thats the iOS gmail app so I really dont have an answer for that. but to replicate the different colors for the 2 line list item you would use the `"textColorPrimary"` and for the second item use `"textColorSecondary"`. You are just going to have to play with the colors really – tyczj Aug 02 '13 at 19:48
2

These are the default colours avail with in android. R.color

It can be accessed programmatically by using android.R.color.colorname or from xml by @android:color/colorname

You can also define your own colors in xml file like this

Community
  • 1
  • 1
VenomVendor
  • 15,064
  • 13
  • 65
  • 96
  • Actually, what I'd like to know is the relationship between these colors and their standard usage. For example, which is the color usually employed for divider bars in light-theme setting screens. – Luis Mendo Aug 02 '13 at 19:15
  • Okay, then the above answer, answers your question :) – VenomVendor Aug 02 '13 at 19:21