# Converters

Summary:[Ctors](https://developer.android.com/reference/android/databinding/adapters/Converters#pubctors)\|[Methods](https://developer.android.com/reference/android/databinding/adapters/Converters#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/databinding/adapters/Converters#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/databinding/adapters/Converters#)  

# Converters

`
public


class
Converters
`  
`

extends `[Object](http://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|-----------------------------------------|
| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.databinding.adapters.Converters |

<br />

*** ** * ** ***

Build in converters to converts for color.

## Summary

|                                                ### Public constructors                                                ||
|--------------------------------------------------------------------------------------------------------------------|---|
| ` `[Converters](https://developer.android.com/reference/android/databinding/adapters/Converters#Converters())`() ` |

|                                                                                                                                                                                              ### Public methods                                                                                                                                                                                               ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[ColorStateList](http://developer.android.com/reference/android/content/res/ColorStateList.html)     | ` `[convertColorToColorStateList](https://developer.android.com/reference/android/databinding/adapters/Converters#convertColorToColorStateList(int))`(int color) ` Converts`int`color into a[ColorStateList](http://developer.android.com/reference/android/content/res/ColorStateList.html). |
| ` static `[ColorDrawable](http://developer.android.com/reference/android/graphics/drawable/ColorDrawable.html) | ` `[convertColorToDrawable](https://developer.android.com/reference/android/databinding/adapters/Converters#convertColorToDrawable(int))`(int color) ` Converts`int`color into a[ColorDrawable](http://developer.android.com/reference/android/graphics/drawable/ColorDrawable.html).         |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/databinding/adapters/Converters#)From class` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                               | | ` boolean`                                                                         | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                            | ` finalize() `                                                                            | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                            | | ` int`                                                                             | ` hashCode() `                                                                            | | ` final void`                                                                      | ` notify() `                                                                              | | ` final void`                                                                      | ` notifyAll() `                                                                           | | ` `[String](http://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                            | | ` final void`                                                                      | ` wait(long arg0, int arg1) `                                                             | | ` final void`                                                                      | ` wait(long arg0) `                                                                       | | ` final void`                                                                      | ` wait() `                                                                                | ||

## Public constructors

### Converters

```
Converters ()
```

<br />

<br />

## Public methods

### convertColorToColorStateList

```
ColorStateList convertColorToColorStateList (int color)
```

Converts`int`color into a[ColorStateList](http://developer.android.com/reference/android/content/res/ColorStateList.html).

<br />

|                           Parameters                            ||
|---------|--------------------------------------------------------|
| `color` | `int`: The integer representation of the color. <br /> |

|                                                                    Returns                                                                    ||
|--------------------------------------------------------------------------------------------------|---------------------------------------------|
| [ColorStateList](http://developer.android.com/reference/android/content/res/ColorStateList.html) | ColorStateList from the single color <br /> |

### convertColorToDrawable

```
ColorDrawable convertColorToDrawable (int color)
```

Converts`int`color into a[ColorDrawable](http://developer.android.com/reference/android/graphics/drawable/ColorDrawable.html).

<br />

|                           Parameters                            ||
|---------|--------------------------------------------------------|
| `color` | `int`: The integer representation of the color. <br /> |

|                                                                    Returns                                                                    ||
|------------------------------------------------------------------------------------------------------|-----------------------------------------|
| [ColorDrawable](http://developer.android.com/reference/android/graphics/drawable/ColorDrawable.html) | ColorDrawable matching the color <br /> |

-

  ## Classes

  - [Converters](https://developer.android.com/reference/android/databinding/adapters/Converters)
  - [ListenerUtil](https://developer.android.com/reference/android/databinding/adapters/ListenerUtil)