diff --git a/core/modules/color/color.es6.js b/core/modules/color/color.es6.js index 6035d3f1aae..4cc26ec855b 100644 --- a/core/modules/color/color.es6.js +++ b/core/modules/color/color.es6.js @@ -85,10 +85,10 @@ * 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. + * It is also symmetrical. If: shift_color(c, a, b) === d, then + * shift_color(d, b, a) === c. * - * @function Drupal.color~shiftColor + * @function Drupal.color~shift_color * * @param {string} given * A hex color code to shift. @@ -100,7 +100,7 @@ * @return {string} * A hex color, shifted. */ - function shiftColor(given, ref1, ref2) { + function shift_color(given, ref1, ref2) { let d; // Convert to HSL. given = farb.RGBToHSL(farb.unpack(given)); @@ -171,14 +171,14 @@ if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { break; } - matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); + matched = shift_color(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } for (j = i - 1; ; --j) { if (!locks[j] || $(locks[j]).is('.is-unlocked')) { break; } - matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); + matched = shift_color(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } diff --git a/core/modules/color/color.js b/core/modules/color/color.js index d45aaa264f6..63cd2db46fd 100644 --- a/core/modules/color/color.js +++ b/core/modules/color/color.js @@ -61,7 +61,7 @@ Drupal.color.callback(context, settings, form, farb, height, width); } - function shiftColor(given, ref1, ref2) { + function shift_color(given, ref1, ref2) { var d = void 0; given = farb.RGBToHSL(farb.unpack(given)); @@ -110,14 +110,14 @@ if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { break; } - matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); + matched = shift_color(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } for (j = i - 1;; --j) { if (!locks[j] || $(locks[j]).is('.is-unlocked')) { break; } - matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); + matched = shift_color(color, reference[input.key], reference[inputs[j].key]); callback(inputs[j], matched, false); } diff --git a/core/modules/color/preview.es6.js b/core/modules/color/preview.es6.js index ac4486038a1..a2f41c6fc23 100644 --- a/core/modules/color/preview.es6.js +++ b/core/modules/color/preview.es6.js @@ -45,17 +45,17 @@ } // Set up gradients if there are some. - let colorStart; - let colorEnd; + let color_start; + let color_end; Object.keys(settings.gradients).forEach((i) => { - colorStart = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[0]}]"]`).val()); - colorEnd = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[1]}]"]`).val()); - if (colorStart && colorEnd) { + color_start = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[0]}]"]`).val()); + color_end = farb.unpack(form.find(`.color-palette input[name="palette[${settings.gradients[i].colors[1]}]"]`).val()); + if (color_start && color_end) { delta = []; - Object.keys(colorStart).forEach((colorStartKey) => { - delta[colorStartKey] = (colorEnd[colorStartKey] - colorStart[colorStartKey]) / (settings.gradients[i].vertical ? height[i] : width[i]); + Object.keys(color_start).forEach((colorStartKey) => { + delta[colorStartKey] = (color_end[colorStartKey] - color_start[colorStartKey]) / (settings.gradients[i].vertical ? height[i] : width[i]); }); - accum = colorStart; + accum = color_start; // Render gradient lines. form.find(`#gradient-${i} > div`).each(gradientLineColor); } diff --git a/core/modules/color/preview.js b/core/modules/color/preview.js index 49ee58f00ad..a0cb1d3c4ea 100644 --- a/core/modules/color/preview.js +++ b/core/modules/color/preview.js @@ -23,17 +23,17 @@ element.style.backgroundColor = farb.pack(accum); } - var colorStart = void 0; - var colorEnd = void 0; + var color_start = void 0; + var color_end = void 0; Object.keys(settings.gradients).forEach(function (i) { - colorStart = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[0] + ']"]').val()); - colorEnd = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[1] + ']"]').val()); - if (colorStart && colorEnd) { + color_start = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[0] + ']"]').val()); + color_end = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[1] + ']"]').val()); + if (color_start && color_end) { delta = []; - Object.keys(colorStart).forEach(function (colorStartKey) { - delta[colorStartKey] = (colorEnd[colorStartKey] - colorStart[colorStartKey]) / (settings.gradients[i].vertical ? height[i] : width[i]); + Object.keys(color_start).forEach(function (colorStartKey) { + delta[colorStartKey] = (color_end[colorStartKey] - color_start[colorStartKey]) / (settings.gradients[i].vertical ? height[i] : width[i]); }); - accum = colorStart; + accum = color_start; form.find('#gradient-' + i + ' > div').each(gradientLineColor); }