# 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)

*** ** * ** ***


```
public final class ArgbEvaluator implements TypeEvaluator<Integer>
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Integer.html` | `https://developer.android.com/reference/androidx/core/animation/ArgbEvaluator#evaluate(float,java.lang.Integer,java.lang.Integer)( float fraction, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Integer.html startValue, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Integer.html endValue )` 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. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/animation/ArgbEvaluator` | `https://developer.android.com/reference/androidx/core/animation/ArgbEvaluator#getInstance()()` Returns an instance of `ArgbEvaluator` that may be used in `https://developer.android.com/reference/androidx/core/animation/ValueAnimator#setEvaluator(androidx.core.animation.TypeEvaluator)`. |

## Public methods

### evaluate

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

```
public @NonNull Integer evaluate(
    float fraction,
    @NonNull Integer startValue,
    @NonNull Integer endValue
)
```

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 |
|---|---|
| `float fraction` | The fraction from the starting to the ending values |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Integer.html startValue` | A 32-bit int value representing colors in the separate bytes of the parameter |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Integer.html endValue` | A 32-bit int value representing colors in the separate bytes of the parameter |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Integer.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)

```
public static @NonNull ArgbEvaluator getInstance()
```

Returns an instance of `ArgbEvaluator` that may be used in `https://developer.android.com/reference/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://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/animation/ArgbEvaluator` | An instance of `ArgbEvaluator`. |