From d8fa6089d4e5d2b808910ba65bd34f39d337fc76 Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Sun, 11 Feb 2024 20:57:42 -0700 Subject: [PATCH] Changes to default table light theme styling --- examples/table/main.go | 20 +++++++------------- table.go | 8 ++++---- table_test.go | 2 +- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/examples/table/main.go b/examples/table/main.go index a584824..63dcc27 100644 --- a/examples/table/main.go +++ b/examples/table/main.go @@ -80,20 +80,14 @@ func main() { panic(err) } - bgColor := charts.Color{R: 16, G: 22, B: 30, A: 255} + bgColor := charts.Color{R: 28, G: 28, B: 32, A: 255} p, err = charts.TableOptionRender(charts.TableChartOption{ - Header: []string{ - "Name", - "Price", - "Change", - }, + Header: []string{"Name", "Price", "Change"}, BackgroundColor: bgColor, - HeaderBackgroundColor: bgColor, - RowBackgroundColors: []charts.Color{ - bgColor, - }, - HeaderFontColor: drawing.ColorWhite, - FontColor: drawing.ColorWhite, + HeaderBackgroundColor: charts.Color{R: 80, G: 80, B: 80, A: 255}, + RowBackgroundColors: []charts.Color{bgColor}, + HeaderFontColor: drawing.ColorWhite, + FontColor: drawing.ColorWhite, Padding: charts.Box{ Top: 15, Right: 10, @@ -138,7 +132,7 @@ func main() { } if value > 0 { style.FillColor = charts.Color{R: 179, G: 53, B: 20, A: 255} - } else if value < 0 { + } else { style.FillColor = charts.Color{R: 33, G: 124, B: 50, A: 255} } return &style diff --git a/table.go b/table.go index 74275e4..bc4d1b7 100644 --- a/table.go +++ b/table.go @@ -83,12 +83,12 @@ type TableSetting struct { } var TableLightThemeSetting = TableSetting{ - HeaderColor: Color{R: 240, G: 240, B: 240, A: 255}, - HeaderFontColor: Color{R: 98, G: 105, B: 118, A: 255}, - FontColor: Color{R: 70, G: 70, B: 70, A: 255}, + HeaderColor: Color{R: 220, G: 220, B: 220, A: 255}, + HeaderFontColor: Color{R: 80, G: 80, B: 80, A: 255}, + FontColor: Color{R: 50, G: 50, B: 50, A: 255}, RowColors: []Color{ drawing.ColorWhite, - {R: 247, G: 247, B: 247, A: 255}, + {R: 245, G: 245, B: 245, A: 255}, }, CellPadding: Box{ Left: 10, diff --git a/table_test.go b/table_test.go index 5b6fa94..82e5671 100644 --- a/table_test.go +++ b/table_test.go @@ -59,7 +59,7 @@ func TestTableChart(t *testing.T) { }, } }, - result: "\\nNameAgeAddressTagActionJohnBrown32New York No. 1 Lake Parknice,developerSend MailJim Green42London No. 1 Lake ParkwowSend MailJoe Black32Sidney No. 1 Lake Parkcool,teacherSend Mail", + result: "\\nNameAgeAddressTagActionJohnBrown32New York No. 1 Lake Parknice,developerSend MailJim Green42London No. 1 Lake ParkwowSend MailJoe Black32Sidney No. 1 Lake Parkcool,teacherSend Mail", }, { theme: GetTheme(ThemeVividDark),