Colors wip

This commit is contained in:
barsdeveloper
2022-11-03 21:56:38 +01:00
parent 37e2e8acf8
commit 5183aae21b
17 changed files with 771 additions and 158 deletions

View File

@@ -6,11 +6,17 @@ import Utility from "../Utility"
/** @extends {IDraggableControlTemplate<ColorHandlerElement>} */
export default class ColorSliderTemplate extends IDraggableControlTemplate {
createInputObjects() {
return [
...super.createInputObjects(),
]
}
/** @param {[Number, Number]} param0 */
adjustLocation([x, y]) {
x = 0
x = Utility.clamp(x, 0, this.movementSpaceSize[0])
y = Utility.clamp(y, 0, this.movementSpaceSize[1])
this.locationChangeCallback?.([x / this.movementSpaceSize[0], 1 - y / this.movementSpaceSize[1]])
this.locationChangeCallback?.(x / this.movementSpaceSize[0], 1 - y / this.movementSpaceSize[1])
return [x, y]
}
}