mix
mix
can create a function that will mix between two values, based on a 0
-1
progress value.
mix
is capable of mixing between many different value types:
Numbers
Colors (RGBA, HSLA)
Complex strings
Arrays and objects of the above
Additionally, RGB color mixing is performed using the linear RGB color space, ensuring colors are mixed without the typical CSS brightness dips/greyness.
Usage
Import from Motion:
Create a mixer by passing two values of the same type:
Pass the mixer function a 0
-1
progress to return a mixed value.
Values outside the 0
-1
range are also accepted.
Easing
You can apply easing to the mixed value by passing progress through an easing function:
Motion is open source. Sponsorships keep the project sustainable.
Every sponsor receives access to our private Discord, and an exclusive mobile and desktop wallpaper pack.