Fix transparency in color pickers again

This commit is contained in:
Sasha Koshka 2024-08-16 13:50:22 -04:00
parent 2fe433991d
commit 669c638fad
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ func (this *HSVAColorPicker) SetValue (value color.Color) {
if value == nil { value = color.Transparent }
this.value = internal.HSVAModel.Convert(value).(internal.HSVA)
this.hueSlider.SetValue(this.value.H)
this.alphaSlider.SetValue(float64(this.value.A) / 255)
this.alphaSlider.SetValue(float64(this.value.A) / 0xFFFF)
}
// OnValueChange specifies a function to be called when the user changes the

View File

@ -91,7 +91,7 @@ func (this *Swatch) Choose () {
committed := false
colorPicker := NewColorPicker(this.Value())
colorPicker := NewHSVAColorPicker(this.Value())
colorPicker.OnValueChange(func () {
this.userSetValue(colorPicker.Value())
})