I have the following code in my fragment:

```
 getActionBar().setBackgroundDrawable(new ColorDrawable(Color.Black));

```

when I click on a button in my fragment, it calls this code. I sets the actionbar to black. However if I change the color to `R.color.primaryColor` it keeps setting the actionbar to a medium grey color. Its so weird though. If I set it to `R.color.primaryColorDark`it gives me the same grey color. 

I am using support action bar which is actually a toolbar.

Am I missing something obvious here?

[EDIT]

Ok i have discovered if I used the android colors liek `Color.BLUE` it works fine, it is giving me the grey color when i use `R.colors.mycustomcolor`

here is my colors.xml

```
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="primaryColor">#2196F3</color>
    <color name="primaryColorDark">#1976D2</color>
    <color name="accentColor">#1976D6</color>
</resources>

```

and when i set the action bar to any of these colors they come out grey.

I only have ONE color.xml so its not taking the wrong color for a different layout type.