mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-17 19:03:27 +08:00
Various color picker improvements
This commit is contained in:
@@ -13,14 +13,9 @@ export default class ColorHandlerTemplate extends IDraggableControlTemplate {
|
||||
y = -(y - radius)
|
||||
let [r, theta] = Utility.getPolarCoordinates([x, y])
|
||||
r = Math.min(r, radius), [x, y] = Utility.getCartesianCoordinates([r, theta])
|
||||
this.locationChangeCallback?.([x / radius, y / radius])
|
||||
x = Math.round(x + radius)
|
||||
y = Math.round(-y + radius)
|
||||
const hsva = this.getColor().toHSVA()
|
||||
this.locationChangeCallback?.([x, y], radius, hsva[2], hsva[3])
|
||||
return [x, y]
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return this.element.windowElement.template.color
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user