Move color functionality into subpackage of internal
This commit is contained in:
@@ -8,7 +8,7 @@ import "git.tebibyte.media/tomo/tomo/input"
|
||||
import "git.tebibyte.media/tomo/tomo/event"
|
||||
import "git.tebibyte.media/tomo/tomo/canvas"
|
||||
import "git.tebibyte.media/tomo/objects/layouts"
|
||||
import "git.tebibyte.media/tomo/objects/internal"
|
||||
import icolor "git.tebibyte.media/tomo/objects/internal/color"
|
||||
|
||||
var _ tomo.Object = new(Swatch)
|
||||
|
||||
@@ -117,7 +117,7 @@ func (this *Swatch) Choose () {
|
||||
|
||||
updateHexInput := func () {
|
||||
nrgba := color.NRGBAModel.Convert(colorPicker.Value()).(color.NRGBA)
|
||||
hexInput.SetValue(internal.FormatNRGBA(nrgba))
|
||||
hexInput.SetValue(icolor.FormatNRGBA(nrgba))
|
||||
}
|
||||
updateHexInput()
|
||||
commit := func () {
|
||||
@@ -130,7 +130,7 @@ func (this *Swatch) Choose () {
|
||||
})
|
||||
hexInput.OnConfirm(commit)
|
||||
hexInput.OnValueChange(func () {
|
||||
nrgba := internal.ParseNRGBA(hexInput.Value())
|
||||
nrgba := icolor.ParseNRGBA(hexInput.Value())
|
||||
this.userSetValue(nrgba)
|
||||
colorPicker.SetValue(nrgba)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user