---
title: "lerp"
description: "Interpolate between two [ParagraphStyle]s.

This will not work well if the styles don't set the same fields.

The [fraction] argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning [start] (or something equivalent to [start]), 1.0
meaning that the interpolation has finished, returning [stop] (or something equivalent to
[stop]), and values in between meaning that the interpolation is at the relevant point on the
timeline between [start] and [stop]. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: ParagraphStyle, stop: ParagraphStyle, fraction: Float): ParagraphStyle
```


Interpolate between two `ParagraphStyle`s.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: TextStyle, stop: TextStyle, fraction: Float): TextStyle
```


Interpolate between two text styles.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: BaselineShift, stop: BaselineShift, fraction: Float): BaselineShift
```


Linearly interpolate two `BaselineShift`s.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(
    start: TextGeometricTransform,
    stop: TextGeometricTransform,
    fraction: Float,
): TextGeometricTransform
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: TextIndent, stop: TextIndent, fraction: Float): TextIndent
```


Linearly interpolate between two `TextIndent`s.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect fun lerp(
    start: PlatformParagraphStyle,
    stop: PlatformParagraphStyle,
    fraction: Float,
): PlatformParagraphStyle
```


Interpolate between two PlatformParagraphStyle's.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect fun lerp(
    start: PlatformSpanStyle,
    stop: PlatformSpanStyle,
    fraction: Float,
): PlatformSpanStyle
```


Interpolate between two PlatformSpanStyle's.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: SpanStyle, stop: SpanStyle, fraction: Float): SpanStyle
```


Interpolate between two span styles.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun lerp(start: FontWeight, stop: FontWeight, fraction: Float): FontWeight
```


Linearly interpolate between two font weights.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for `fraction` are usually obtained from an `Animation<Float>`, such as an
`AnimationController`.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual fun lerp(
    start: PlatformParagraphStyle,
    stop: PlatformParagraphStyle,
    fraction: Float,
): PlatformParagraphStyle
```


Interpolate between two PlatformParagraphStyle's.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual fun lerp(
    start: PlatformSpanStyle,
    stop: PlatformSpanStyle,
    fraction: Float,
): PlatformSpanStyle
```


Interpolate between two PlatformSpanStyle's.

This will not work well if the styles don't set the same fields.

The `fraction` argument represents position on the timeline, with 0.0 meaning that the
interpolation has not started, returning `start` (or something equivalent to `start`), 1.0
meaning that the interpolation has finished, returning `stop` (or something equivalent to
`stop`), and values in between meaning that the interpolation is at the relevant point on the
timeline between `start` and `stop`. The interpolation can be extrapolated beyond 0.0 and 1.0, so
negative values and values greater than 1.0 are valid.



