# ArgbEvaluator

Artifact: [androidx.core:core-animation](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/animation/ArgbEvaluator.java+class:androidx.core.animation.ArgbEvaluator) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
class ArgbEvaluator : TypeEvaluator<Int!>
```

<br />

*** ** * ** ***

This evaluator can be used to perform type interpolation between integer values that represent ARGB colors.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/animation/ArgbEvaluator#evaluate(float,java.lang.Integer,java.lang.Integer)(fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, startValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, endValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` This function returns the calculated in-between value for a color given integers that represent the start and end values in the four bytes of the 32-bit int. |
| `java-static https://developer.android.com/reference/kotlin/androidx/core/animation/ArgbEvaluator` | `https://developer.android.com/reference/kotlin/androidx/core/animation/ArgbEvaluator#getInstance()()` Returns an instance of `ArgbEvaluator` that may be used in `https://developer.android.com/reference/kotlin/androidx/core/animation/ValueAnimator#setEvaluator(androidx.core.animation.TypeEvaluator)`. |

## Public functions

### evaluate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
fun evaluate(fraction: Float, startValue: Int, endValue: Int): Int
```

This function returns the calculated in-between value for a color given integers that represent the start and end values in the four bytes of the 32-bit int. Each channel is separately linearly interpolated and the resulting calculated values are recombined into the return value.

| Parameters |
|---|---|
| `fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The fraction from the starting to the ending values |
| `startValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A 32-bit int value representing colors in the separate bytes of the parameter |
| `endValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A 32-bit int value representing colors in the separate bytes of the parameter |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A value that is calculated to be the linearly interpolated result, derived by separating the start and end values into separate color channels and interpolating each one separately, recombining the resulting values in the same way. |

### getInstance

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
java-static fun getInstance(): ArgbEvaluator
```

Returns an instance of `ArgbEvaluator` that may be used in `https://developer.android.com/reference/kotlin/androidx/core/animation/ValueAnimator#setEvaluator(androidx.core.animation.TypeEvaluator)`. The same instance may be used in multiple `Animator`s because it holds no state.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/animation/ArgbEvaluator` | An instance of `ArgbEvaluator`. |