androidx.compose.ui.graphics
Interpolatable
Interface · from org.jetbrains.compose.ui:ui-graphics:1.12.2
No hand-written docs yet.
Represents an object which may be able to be linearly interpolated with another object. Usually used during animation.
interface Interpolatable
Kinds of Interpolatable
Anywhere a Interpolatable is expected, you can pass any of these.
CornerBasedShapefoundation — A shape made of four corners.AbsoluteCutCornerShapefoundationAbsoluteRoundedCornerShapefoundationCutCornerShapefoundationRoundedCornerShapefoundation — Rounded corners. The shape you create most often.
LinearGradientui-graphicsRadialGradientui-graphicsSolidColorui-graphicsSweepGradientui-graphics
How to get one
Or create one of the kinds listed above.
Functions
lerp
fun lerp(other: Any?, t: Float): Any?
This method is defined such that a value of t being 1.0 means that the interpolation has finished, meaning that this method should return either other (or something equivalent to other), 0.0 meaning that the interpolation has not started, returning this (or something equivalent to this), and values in between meaning that the interpolation is at the relevant point on the timeline between this and other. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.
fun lerp(
a: Any?,
b: Any?,
t: Float,
): Any?
Attempt to Linearly interpolates between two values. If either of the values are Interpolatable, this will attempt to use their lerp functions. If the interpolation is not possible, this will return a if t is less than 0.5 and b otherwise.
Library docs
Represents an object which may be able to be linearly interpolated with another object. Usually used during animation.