The t argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning a (or something equivalent to a), 1.0 meaning that the interpolation has finished, returning b (or something equivalent to b), and values in between meaning that the interpolation is at the relevant point on the timeline between a and b.
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).
If a or b are both null, this will return null. If only one of the arguments is null, the null argument will be replaced with a transparent copy of the non-null argument
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-13 UTC.
[null,null,["Last updated 2025-08-13 UTC."],[],[],null,["# androidx.compose.ui.graphics.shadow\n===================================\n\nCommon/AllAndroid/JVM\n\nInterfaces\n----------\n\n|--------------------------------------------------------------------------------------|-------------------------------------------------------------|-----|\n| [ShadowContext](/reference/kotlin/androidx/compose/ui/graphics/shadow/ShadowContext) | Class responsible for managing shadow related dependencies. | Cmn |\n\nClasses\n-------\n\n|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [DropShadowPainter](/reference/kotlin/androidx/compose/ui/graphics/shadow/DropShadowPainter) | [Painter](/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) implementation that draws a drop shadow with the geometry defined by the specified shape and [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow). | Cmn |\n| [InnerShadowPainter](/reference/kotlin/androidx/compose/ui/graphics/shadow/InnerShadowPainter) | [Painter](/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) implementation that draws an inner shadow with the geometry defined by the specified shape and [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow). | Cmn |\n| [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow) | Group of parameters that represent how a drop shadow or inner shadow should be rendered. | Cmn |\n\nTop-level functions summary\n---------------------------\n\n|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| [ShadowContext](/reference/kotlin/androidx/compose/ui/graphics/shadow/ShadowContext) | [ShadowContext](/reference/kotlin/androidx/compose/ui/graphics/shadow/package-summary#ShadowContext())`()` Create a new [ShadowContext](/reference/kotlin/androidx/compose/ui/graphics/shadow/ShadowContext) | android |\n| [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)`?` | [lerp](/reference/kotlin/androidx/compose/ui/graphics/shadow/package-summary#lerp(androidx.compose.ui.graphics.shadow.Shadow,androidx.compose.ui.graphics.shadow.Shadow,kotlin.Float))`(a: `[Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)`?, b: `[Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)`?, t: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Linearly interpolate between two [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)s. | Cmn |\n\nTop-level functions\n-------------------\n\n### ShadowContext\n\nandroid \nArtifact: [androidx.compose.ui:ui-graphics](/jetpack/androidx/releases/compose-ui) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/shadow/AndroidShadowContext.android.kt+function:ShadowContext) \n\n```\nfun ShadowContext(): ShadowContext\n```\n\nCreate a new [ShadowContext](/reference/kotlin/androidx/compose/ui/graphics/shadow/ShadowContext) \n\n### lerp\n\nCmn \nArtifact: [androidx.compose.ui:ui-graphics](/jetpack/androidx/releases/compose-ui) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/shadow/Shadow.kt+function:lerp) \nAdded in [1.10.0-alpha01](/jetpack/androidx/releases/compose-ui#1.10.0-alpha01) \n\n```\nfun lerp(a: Shadow?, b: Shadow?, t: Float): Shadow?\n```\n\nLinearly interpolate between two [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)s.\n\nThe [t](/reference/kotlin/androidx/compose/ui/graphics/shadow/package-summary#lerp(androidx.compose.ui.graphics.shadow.Shadow,androidx.compose.ui.graphics.shadow.Shadow,kotlin.Float)) argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning `a` (or something equivalent to `a`), 1.0 meaning that the interpolation has finished, returning `b` (or something equivalent to `b`), and values in between meaning that the interpolation is at the relevant point on the timeline between `a` and `b`.\n\nThe 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).\n\nIf [a](/reference/kotlin/androidx/compose/ui/graphics/shadow/package-summary#lerp(androidx.compose.ui.graphics.shadow.Shadow,androidx.compose.ui.graphics.shadow.Shadow,kotlin.Float)) or [b](/reference/kotlin/androidx/compose/ui/graphics/shadow/package-summary#lerp(androidx.compose.ui.graphics.shadow.Shadow,androidx.compose.ui.graphics.shadow.Shadow,kotlin.Float)) are both null, this will return `null`. If only one of the arguments is null, the null argument will be replaced with a transparent copy of the non-null argument \n\n| Parameters |\n|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| `a: `[Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)`?` | Start [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow) at t = 0f |\n| `b: `[Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)`?` | End [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow) at t = 1f |\n| `t: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | Position on the timeline |\n\n| Returns |\n|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow)`?` | Interpolated [Shadow](/reference/kotlin/androidx/compose/ui/graphics/shadow/Shadow) |"]]