Type Definitions
EasingFunction
Get a smoothly interpolated color from the palette
Type:
- Source:
EasingFunction
Create a gradient palette from an array of Color objects
Type:
- Source:
EasingFunction
Create a gradient palette from HEX color strings
Type:
- Source:
EasingFunction
Create a gradient palette from RGB color arrays
Type:
- Source:
RandomClass
Shuffle the colors in the palette
Type:
- Source:
RandomClass
Get a random color from the palette
Type:
- Source:
RandomClass
Get a random palette from the factory
Type:
- Source:
easingFunction(other, amount, easingopt) → {Color}
Mix two colors, returning a new color.
Optionally, an easing function can be passed to control the mix.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
other |
Color | The other color to mix with | |
amount |
number | The amount of the other color in range [0, 1] | |
easing |
easingFunction |
<optional> |
An optional easing function that accepts a number in range [0, 1] and returns a number in range [0, 1] |
Returns:
The mixed color
- Type
- Color
easingFunction(amount, easing) → {Color}
Darken the color by a certain amount, returning a new color.
Optionally, an easing function can be passed to control the mix.
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number | The amount to darken in range [0, 1] |
easing |
easingFunction | An optional easing function that accepts a number in range [0, 1] and returns a number in range [0, 1] |
Returns:
The darkened color
- Type
- Color
easingFunction(amount, easing) → {Color}
Lighten the color by a certain amount, returning a new color.
Optionally, an easing function can be passed to control the mix.
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number | The amount to lighten in range [0, 1] |
easing |
easingFunction | An optional easing function that accepts a number in range [0, 1] and returns a number in range [0, 1] |
Returns:
The lightened color
- Type
- Color