diff options
| author | Jeff Carr <[email protected]> | 2019-06-05 10:01:36 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-05 10:01:36 -0700 |
| commit | ba93e331fdc2a7ec883ac2f9e954e60d99f24285 (patch) | |
| tree | 9398cafef120a380722bdf84ec5bf6d9a005fe08 /color.go | |
| parent | 224740b4b8f346eba159004c82ed54ce52c2adb2 (diff) | |
reimplement the color button
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'color.go')
| -rw-r--r-- | color.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/color.go b/color.go new file mode 100644 index 0000000..cf4a362 --- /dev/null +++ b/color.go @@ -0,0 +1,31 @@ +package gui + +// +// convert between 'standard' golang Color and andlabs/ui Color +// + +// import "log" +// import "fmt" +import "image/color" + +import "github.com/andlabs/ui" +import _ "github.com/andlabs/ui/winmanifest" + +func libuiColorToGOlangColor(rgba color.RGBA) ui.TableColor { + /* a hack to see if colors work differently on macos or windows + if (rgba.R == 72) { + log.Println("SETTING COLOR TO NIL") + log.Println("SETTING COLOR TO NIL") + log.Println("SETTING COLOR TO NIL") + return ui.TableColor{} + } + */ + return ui.TableColor{float64(rgba.R) / 256, float64(rgba.G) / 256, float64(rgba.B) / 256, float64(rgba.A) / 256} +} + +/* +func golangColorGOlibuiColorTo (ui.TableColor) (rgba color.RGBA) { + color.RGBA{float64(, 100, 200, 100} + return ui.TableColor{float64(rgba.R) / 256, float64(rgba.G) / 256, float64(rgba.B) / 256, float64(rgba.A) / 256} +} +*/ |
