Methods
# applyTheme(themeName) → {Object}
Apply a theme to animation settings
Parameters:
Name | Type | Description |
---|---|---|
themeName |
string
|
Name of the theme to apply |
Theme configuration
Object
# createCustomTheme(name, config)
Create a custom theme
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Theme name |
config |
Object
|
Theme configuration |
# createGradient(ctx, gradientType, coordinates) → {CanvasGradient}
Get gradient colors for canvas
Parameters:
Name | Type | Default | Description |
---|---|---|---|
ctx |
CanvasRenderingContext2D
|
Canvas context |
|
gradientType |
string
|
primary | 'primary', 'secondary', or 'accent' |
coordinates |
Object
|
{x1, y1, x2, y2} for linear gradient |
Canvas gradient object
CanvasGradient
# easeInOutCubic(t) → {number}
Cubic easing function
Parameters:
Name | Type | Description |
---|---|---|
t |
number
|
Time parameter (0-1) |
Eased value
number
# enableThemeCycling(themes, intervalopt)
Enable automatic theme cycling
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
themes |
Array
|
Array of theme names to cycle through |
||
interval |
number
|
<optional> |
10000 | Time between changes in milliseconds |
# getAnimationSettings(animationType) → {Object}
Generate theme-appropriate settings for animations
Parameters:
Name | Type | Description |
---|---|---|
animationType |
string
|
Type of animation |
Animation-specific settings
Object
# getAvailableThemes() → {Array.<string>}
Get all available themes
Array of theme names
Array.<string>
# getBackgroundColor(opacityopt) → {string}
Get background color for current theme
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
opacity |
number
|
<optional> |
0.1 | Background opacity |
Background color with opacity
string
# getCurrentColors() → {Array.<string>}
Get current theme colors
Array of current colors
Array.<string>
# getEffectColor(effectType) → {string}
Get effect color from current theme
Parameters:
Name | Type | Description |
---|---|---|
effectType |
string
|
'glow', 'highlight', or 'shadow' |
Hex color string
string
# getRandomColor(categoryopt) → {string}
Get random color from current theme
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
category |
string
|
<optional> |
'colors' | Color category ('colors', 'primary', 'secondary', 'accent') |
Hex color string
string
# getRecommendedAnimations() → {Array.<string>}
Get recommended animations for current theme
Array of animation names
Array.<string>
# interpolateColor(color1, color2, factor) → {string}
Interpolate between two colors
Parameters:
Name | Type | Description |
---|---|---|
color1 |
string
|
Start color (hex or rgb) |
color2 |
string
|
End color (hex or rgb) |
factor |
number
|
Interpolation factor (0-1) |
Interpolated color
string
# parseColor(color) → {Object}
Parse color string to RGB object
Parameters:
Name | Type | Description |
---|---|---|
color |
string
|
Color string |
RGB object
Object
# toRgba(color, opacityopt) → {string}
Convert any color to rgba format
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
color |
string
|
Input color (hex, rgb, rgba) |
||
opacity |
number
|
<optional> |
1 | Opacity (0-1) |
RGBA color string
string
# transitionToTheme(newTheme, durationopt, easingFunctionopt)
Smooth transition between themes
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
newTheme |
string
|
Target theme name |
||
duration |
number
|
<optional> |
2000 | Transition duration in milliseconds |
easingFunction |
function
|
<optional> |
Custom easing function |