changeset 2265:18d6bdd422f2

update after boost
author drewp@bigasterisk.com
date Mon, 29 May 2023 11:48:00 -0700
parents 74b4acd3dde0
children dfdc00c4c8fb
files light9/web/light9-color-picker.ts
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/light9-color-picker.ts	Mon May 29 11:47:35 2023 -0700
+++ b/light9/web/light9-color-picker.ts	Mon May 29 11:48:00 2023 -0700
@@ -63,9 +63,7 @@
       this.setColor(this.color);
     }
     if (changedProperties.has("value") || changedProperties.has("hueSatColor")) {
-      this.color = color(this.hueSatColor)
-        .value(this.value / 255)
-        .hex();
+      this.updateColorFromHSV();
 
       this.dispatchEvent(new CustomEvent("input", { detail: { value: this.color } }));
 
@@ -75,6 +73,12 @@
     }
   }
 
+  private updateColorFromHSV() {
+    this.color = color(this.hueSatColor)
+      .value(this.value / 255)
+      .hex();
+  }
+
   private onVSliderChange(ev: CustomEvent) {
     this.value = ev.detail.value;
   }
@@ -93,6 +97,7 @@
     if (this.value < (20 as int8)) {
       log("boost");
       this.value = 255 as int8;
+      this.updateColorFromHSV();
     }
     pickerFloat.startPick(new ClientCoord(ev.clientX, ev.clientY), this.color, (hsc: string) => {
       this.hueSatColor = hsc;