Interpolatable
public protocol Interpolatable
A type that can be linearly interpolated.
-
The type of the fraction that will be used to linearly interpolate
Self.Declaration
Swift
associatedtype FractionType : FloatingPoint -
Linearly interpolates
Selfto another instance ofSelfbased on a given fraction.Declaration
Swift
func lerp(to: Self, fraction: FractionType) -> SelfParameters
toThe end value to interpolate to.
fractionThe fraction to interpolate between the two values (i.e. 0% is 0.0, 100% is 1.0).
Return Value
An interpolated instance of
Self.
Interpolatable Protocol Reference