Namespace: color

Drupal. color

Namespace for color-related functionality for Drupal.

Methods

staticDrupal.color.callback(context, settings, form, farb, height, width)

The callback for when the color preview has been attached.

Name Type Description
context Element

The context to initiate the color behaviour.

settings object

Settings for the color functionality.

form HTMLFormElement

The form to initiate the color behaviour on.

farb object

The farbtastic object.

height number

Height of gradient.

width number

Width of gradient.

innershift_color(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: shift_color(c, a, b) === d, then shift_color(d, b, a) === c.

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.

Returns:
Type Description
string A hex color, shifted.