Methods
# applyEasing(t, easingType) → {number}
Apply easing function
Parameters:
Name | Type | Description |
---|---|---|
t |
number
|
Time parameter (0-1) |
easingType |
string
|
Easing type |
Eased value
number
# bounceEasing(t) → {number}
Bounce easing function
Parameters:
Name | Type | Description |
---|---|---|
t |
number
|
Time parameter |
Bounced value
number
# elasticEasing(t) → {number}
Elastic easing function
Parameters:
Name | Type | Description |
---|---|---|
t |
number
|
Time parameter |
Elastic value
number
# hexToRgb(hex) → {Object}
Convert hex to RGB
Parameters:
Name | Type | Description |
---|---|---|
hex |
string
|
Hex color |
RGB object
Object
# interpolate(nextKeyframe, progress) → {Object}
Interpolate between this keyframe and another
Parameters:
Name | Type | Description |
---|---|---|
nextKeyframe |
Keyframe
|
Next keyframe |
progress |
number
|
Progress (0-1) |
Interpolated properties
Object
# interpolateColor(color1, color2, progress) → {string}
Interpolate between two colors
Parameters:
Name | Type | Description |
---|---|---|
color1 |
string
|
Start color (hex) |
color2 |
string
|
End color (hex) |
progress |
number
|
Progress (0-1) |
Interpolated color
string
# rgbToHex(r, g, b) → {string}
Convert RGB to hex
Parameters:
Name | Type | Description |
---|---|---|
r |
number
|
Red component |
g |
number
|
Green component |
b |
number
|
Blue component |
Hex color
string