Module
Hylograph.Transition.Interpolate
- Package
- purescript-hylograph-transitions
- Repository
- afcondon/purescript-hylograph-transitions
Value Interpolation
Type-safe interpolation functions for various value types. Used with easing functions from Hylograph.Transition.Tick to create smooth transitions.
Usage:
import Hylograph.Transition.Interpolate as I
import Hylograph.Transition.Tick (easeOutQuad, withEasing)
-- Interpolate a color with easing
let color = withEasing easeOutQuad (I.lerpRGB red blue) progress
-- Interpolate a point
let pos = I.lerpPoint origin target progress
#Interpolatable Source
class Interpolatable a whereTypeclass for types that can be interpolated
Members
interpolate :: a -> a -> Progress -> a
Instances
#Interpolator Source
type Interpolator a = a -> a -> Progress -> aAn interpolation function between two values
#makeInterpolator Source
makeInterpolator :: forall a. Interpolatable a => a -> a -> (Progress -> a)Create an interpolator that captures the start and end values