Color picker improvements

This commit is contained in:
barsdeveloper
2022-10-16 13:56:38 +02:00
parent 0b19d89416
commit 192f2a4c11
23 changed files with 500 additions and 231 deletions

View File

@@ -1,6 +1,5 @@
import LinearColorEntity from "../entity/LinearColorEntity"
import ColorHandlerTemplate from "../template/ColorHandlerTemplate"
import IDraggableElement from "./IDraggableElement"
import IDraggableControlElement from "./IDraggableControlElement"
/** @typedef {import("../template/ColorPickerWindowTemplate").default} ColorPickerWindowTemplate */
/**
@@ -8,29 +7,12 @@ import IDraggableElement from "./IDraggableElement"
* @typedef {import("./WindowElement").default<T>} WindowElement
*/
/** @extends {IDraggableElement<Object, ColorHandlerTemplate>} */
export default class ColorHandlerElement extends IDraggableElement {
/** @type {WindowElement<ColorPickerWindowTemplate>} */
windowElement
/** @extends {IDraggableControlElement<Object, ColorHandlerTemplate>} */
export default class ColorHandlerElement extends IDraggableControlElement {
constructor() {
super({}, new ColorHandlerTemplate())
}
connectedCallback() {
super.connectedCallback()
this.windowElement = this.closest("ueb-window")
}
/** @param {Number[]} param0 */
setLocation([x, y]) {
super.setLocation(this.template.adjustLocation([x, y]))
}
computeColor() {
return new LinearColorEntity()
}
}
customElements.define("ueb-color-handler", ColorHandlerElement)