summaryrefslogtreecommitdiff
path: root/color.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-08 23:22:47 -0500
committerJeff Carr <[email protected]>2022-10-08 23:22:47 -0500
commit086986b6b8f55d15d18595bcbf3f76c023365b61 (patch)
tree9f1dc4da5b2d125f7a017418d4d9912e16b71039 /color.go
parentf92a50e2e665a18e2201f1d6714025dcc39301cc (diff)
parent45644ef9bc333f5def62d1c7f474dc96274e63fa (diff)
Merge branch 'master' into jcarr
Diffstat (limited to 'color.go')
-rw-r--r--color.go31
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}
+}
+*/