try to return a nil color

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-23 14:02:04 -07:00
parent e00585d71a
commit 3e8617d05c
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,12 @@ func (mh *TableData) ColumnTypes(m *ui.TableModel) []ui.TableValue {
}
func libuiColorToGOlangColor(rgba color.RGBA) ui.TableColor {
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}
}
@ -44,6 +50,7 @@ func (mh *TableData) CellValue(m *ui.TableModel, row, column int) ui.TableValue
}
if (column == mh.Human[humanID].ColorID) {
return libuiColorToGOlangColor(mh.Rows[row].HumanData[humanID].Color)
return libuiColorToGOlangColor(mh.Rows[row].HumanData[humanID].Color)
}
log.Println("CellValue() FAILURE")
log.Println("CellValue() FAILURE")