diff --git a/colorpicker.go b/colorpicker.go index 7fc0206..0f5d3ed 100644 --- a/colorpicker.go +++ b/colorpicker.go @@ -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 diff --git a/swatch.go b/swatch.go index 66bc4e1..3cde31e 100644 --- a/swatch.go +++ b/swatch.go @@ -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()) })