{"action":"created","issue":{"url":"https://api.github.com/repos/bgrins/spectrum/issues/383","labels_url":"https://api.github.com/repos/bgrins/spectrum/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/bgrins/spectrum/issues/383/comments","events_url":"https://api.github.com/repos/bgrins/spectrum/issues/383/events","html_url":"https://github.com/bgrins/spectrum/issues/383","id":122168850,"number":383,"title":"Rotate the .alphaSlider 180 deg","user":{"login":"Horray","id":12147037,"avatar_url":"https://avatars.githubusercontent.com/u/12147037?v=3","gravatar_id":"","url":"https://api.github.com/users/Horray","html_url":"https://github.com/Horray","followers_url":"https://api.github.com/users/Horray/followers","following_url":"https://api.github.com/users/Horray/following{/other_user}","gists_url":"https://api.github.com/users/Horray/gists{/gist_id}","starred_url":"https://api.github.com/users/Horray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Horray/subscriptions","organizations_url":"https://api.github.com/users/Horray/orgs","repos_url":"https://api.github.com/users/Horray/repos","events_url":"https://api.github.com/users/Horray/events{/privacy}","received_events_url":"https://api.github.com/users/Horray/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-15T01:08:01Z","updated_at":"2015-12-15T01:21:59Z","closed_at":null,"body":" 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.\r\n\r\nHow can I edit the source file so that I can rotate 180 Deg the `.alphaSlider`?\r\n\r\n[Source: (Lines: 387-395)][3]\r\n\r\n    draggable(alphaSlider, function (dragX, dragY, e) {\r\n        currentAlpha = (dragX / alphaWidth);\r\n        isEmpty = false;\r\n        if (e.shiftKey) {\r\n            currentAlpha = Math.round(currentAlpha * 10) / 10;\r\n        }\r\n        move();\r\n    }, dragStart, dragStop);\r\n\r\n[Source: (Lines: 1068 - 1073)][4]\r\n\r\n    var t0 = e.originalEvent && e.originalEvent.touches && e.originalEvent.touches[0];\r\n    var pageX = t0 && t0.pageX || e.pageX;\r\n    var pageY = t0 && t0.pageY || e.pageY;\r\n\r\n    var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth));\r\n    var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight));\r\n\r\n\r\n  [3]: https://github.com/bgrins/spectrum/blob/master/spectrum.js#L387-L395\r\n  [4]: https://github.com/bgrins/spectrum/blob/master/spectrum.js#L1068-L1073"},"comment":{"url":"https://api.github.com/repos/bgrins/spectrum/issues/comments/164611621","html_url":"https://github.com/bgrins/spectrum/issues/383#issuecomment-164611621","issue_url":"https://api.github.com/repos/bgrins/spectrum/issues/383","id":164611621,"user":{"login":"bgrins","id":95570,"avatar_url":"https://avatars.githubusercontent.com/u/95570?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrins","html_url":"https://github.com/bgrins","followers_url":"https://api.github.com/users/bgrins/followers","following_url":"https://api.github.com/users/bgrins/following{/other_user}","gists_url":"https://api.github.com/users/bgrins/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrins/subscriptions","organizations_url":"https://api.github.com/users/bgrins/orgs","repos_url":"https://api.github.com/users/bgrins/repos","events_url":"https://api.github.com/users/bgrins/events{/privacy}","received_events_url":"https://api.github.com/users/bgrins/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T01:21:59Z","updated_at":"2015-12-15T01:21:59Z","body":"I think you'd need to change `currentAlpha = (dragX / alphaWidth);` to something like `currentAlpha = ((alphaWidth - dragX) / alphaWidth);`.  You shouldn't need to change any of the draggable bits"}}