summaryrefslogtreecommitdiff
path: root/tableCallbacks.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-21 15:17:50 -0700
committerJeff Carr <[email protected]>2019-05-21 15:17:50 -0700
commit0826a0459346dee914e6bdd466f0abde698b506e (patch)
tree0633145fbb888c546bdc4b61c070041325a37bf4 /tableCallbacks.go
parentc3ba0117dfaeb2ba74a3abc5146e6cb8fcfac8e1 (diff)
use the standard golang 'image/color' struct
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'tableCallbacks.go')
-rw-r--r--tableCallbacks.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/tableCallbacks.go b/tableCallbacks.go
index 59fb8f6..a5d8efa 100644
--- a/tableCallbacks.go
+++ b/tableCallbacks.go
@@ -8,6 +8,7 @@ package gui
import "log"
import "fmt"
+import "image/color"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
@@ -23,6 +24,10 @@ func (mh *TableData) ColumnTypes(m *ui.TableModel) []ui.TableValue {
return mh.generatedColumnTypes
}
+func libuiColorToGOlangColor(rgba color.RGBA) ui.TableColor {
+ return ui.TableColor{float64(rgba.R) / 256, float64(rgba.G) / 256, float64(rgba.B) / 256, float64(rgba.A) / 256}
+}
+
// TODO: Figure out why this is being called 1000 times a second (10 times for each row & column)
// Nevermind this TODO. Who gives a shit. This is a really smart way to treat the OS toolkits
func (mh *TableData) CellValue(m *ui.TableModel, row, column int) ui.TableValue {
@@ -31,7 +36,7 @@ func (mh *TableData) CellValue(m *ui.TableModel, row, column int) ui.TableValue
return ui.TableString(mh.Rows[row].HumanData[humanID].Text)
}
if (column == mh.Human[humanID].ColorID) {
- return mh.Rows[row].HumanData[humanID].Color
+ return libuiColorToGOlangColor(mh.Rows[row].HumanData[humanID].Color)
}
log.Println("CellValue() FAILURE")
log.Println("CellValue() FAILURE")