Namespace for color-related functionality for Drupal.
- Source:
Methods
(static) callback(context, settings, form, farb, height, width)
The callback for when the color preview has been attached.
Parameters:
Name | Type | Description |
---|---|---|
context |
Element | The context to initiate the color behavior. |
settings |
object | Settings for the color functionality. |
form |
HTMLFormElement | The form to initiate the color behavior on. |
farb |
object | The farbtastic object. |
height |
number | Height of gradient. |
width |
number | Width of gradient. |
- Source:
(inner) shiftColor(given, ref1, ref2) → {string}
Shifts a given color, using a reference pair (ref in HSL).
This algorithm ensures relative ordering on the saturation and luminance axes is preserved, and performs a simple hue shift.
It is also symmetrical. If: shiftColor(c, a, b) === d, then shiftColor(d, b, a) === c.
Parameters:
Name | Type | Description |
---|---|---|
given |
string | A hex color code to shift. |
ref1 |
Array.<number> | First HSL color reference. |
ref2 |
Array.<number> | Second HSL color reference. |
- Source:
Returns:
A hex color, shifted.
- Type
- string