Various color picker improvements

This commit is contained in:
barsdeveloper
2022-10-22 23:06:37 +02:00
parent 14d376d447
commit acea290c9d
23 changed files with 562 additions and 279 deletions

View File

@@ -10,12 +10,7 @@ export default class ColorSliderTemplate extends IDraggableControlTemplate {
adjustLocation([x, y]) {
x = 0
y = Utility.clamp(y, 0, this.movementSpaceSize[1])
const hsva = this.getColor().toHSVA()
this.locationChangeCallback?.([x, y])
this.locationChangeCallback?.([x / this.movementSpaceSize[0], 1 - y / this.movementSpaceSize[1]])
return [x, y]
}
getColor() {
return this.element.windowElement.template.color
}
}