I implemented spectrum color picker. I'm trying to rotate the .alphaSlider
180 deg. Of course I can do it with CSS (using transform: rotate(180deg)
), but that's sort of a hack, and, there will anyway be other problems. I want to do it using the JavaScript source file.
How can I edit the source file so that I can rotate 180 Deg the .alphaSlider
?
Here's the relevant code:
draggable(alphaSlider, function (dragX, dragY, e) {
currentAlpha = (dragX / alphaWidth);
isEmpty = false;
if (e.shiftKey) {
currentAlpha = Math.round(currentAlpha * 10) / 10;
}
move();
}, dragStart, dragStop);
var t0 = e.originalEvent && e.originalEvent.touches && e.originalEvent.touches[0];
var pageX = t0 && t0.pageX || e.pageX;
var pageY = t0 && t0.pageY || e.pageY;
var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth));
var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight));