diff options
Diffstat (limited to 'tableCallbacks.go')
| -rw-r--r-- | tableCallbacks.go | 7 |
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") |
