Question: From the sample in the `SDK` for floating action buttons I have a `drawable`:

```
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
    <ripple android:color="@color/primary_light">
        <item>
            <shape android:shape="oval">
                <solid android:color="@color/primary" />
            </shape>
        </item>
    </ripple>
</item>

<item>
    <ripple android:color="@color/primary_light">
        <item>
            <shape android:shape="oval">
                <solid android:color="@color/primary" />
            </shape>
        </item>
    </ripple>
</item>
</selector>

```

and I'm setting my `TextView` background: 

```
android:background="@drawable/fab_background"

```

Is there a way that I can access `fab_background` or edit my `TextView` background itself to change the color of my FAB?

Answer: 
You can change color of FAB by setting the following attribute of `<android.support.design.widget.FloatingActionButton>` in the layout xml:

```
app:backgroundTint="#ff0000"

```
If you're targeting API 21+, you can take advantage of drawable tinting and drawable color state lists by specifying your base drawable as `@android:color/white` and applying a color state list as a tint.

You can also optionally take advantage of drawable themeing if you'd like to use the platform-default ripple color. I've used this in the example below.

res/values/colors.xml:

```
<resources>
  <color name="fab_checked">...</color>
  <color name="fab_normal">...</color>
  ...
</resources>

```

res/color/fab\_tint.xml:

```
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_checked="true"
        android:color="@color/fab_checked" />
  <item android:color="@color/fab_normal" />
</selector>

```

res/drawable/fab.xml:

```
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="?android:attr/colorControlHighlight">
    <item>
        <shape android:shape="oval"
               android:tint="@color/fab_tint">
            <solid android:color="@color/white" />
        </shape>
    </item>
</ripple>

```

If you want to change the tint dynamically, you can just call `Drawable.setTint(int)` or `Drawable.setTintList(ColorStateList)`.

```
myFab.getDrawable().mutate().setTint(Color.RED);

```

If you want to preserve the checked state color, you can create a new `ColorStateList` and apply that.

```
ColorStateList csl = new ColorStateList(
    new int[][] {{android.R.attr.state_checked},{}},
    new int[] {Color.GREEN, Color.RED});
myFab.getDrawable().mutate().setTintList(csl);

```