2017-01-14 14:07:43 +08:00
|
|
|
// Copyright 2017 Zack Guo <zack.y.guo@gmail.com>. All rights reserved.
|
2015-03-21 04:21:50 +08:00
|
|
|
// Use of this source code is governed by a MIT license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
2015-03-12 04:15:59 +08:00
|
|
|
package termui
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
var StandardColors = []Color{
|
|
|
|
ColorRed,
|
|
|
|
ColorGreen,
|
|
|
|
ColorYellow,
|
|
|
|
ColorBlue,
|
|
|
|
ColorMagenta,
|
|
|
|
ColorCyan,
|
|
|
|
ColorWhite,
|
2015-03-12 04:15:59 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
var StandardStyles = []Style{
|
|
|
|
NewStyle(ColorRed),
|
|
|
|
NewStyle(ColorGreen),
|
|
|
|
NewStyle(ColorYellow),
|
|
|
|
NewStyle(ColorBlue),
|
|
|
|
NewStyle(ColorMagenta),
|
|
|
|
NewStyle(ColorCyan),
|
|
|
|
NewStyle(ColorWhite),
|
2015-03-12 04:15:59 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type RootTheme struct {
|
|
|
|
Default Style
|
|
|
|
|
|
|
|
Block BlockTheme
|
|
|
|
|
|
|
|
BarChart BarChartTheme
|
|
|
|
Gauge GaugeTheme
|
|
|
|
LineChart LineChartTheme
|
|
|
|
List ListTheme
|
|
|
|
Paragraph ParagraphTheme
|
|
|
|
PieChart PieChartTheme
|
|
|
|
Sparkline SparklineTheme
|
|
|
|
StackedBarChart StackedBarChartTheme
|
|
|
|
Tab TabTheme
|
|
|
|
Table TableTheme
|
|
|
|
}
|
2015-03-12 04:15:59 +08:00
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type BlockTheme struct {
|
|
|
|
Title Style
|
|
|
|
Border Style
|
2015-03-20 17:35:09 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type BarChartTheme struct {
|
|
|
|
Bars []Color
|
|
|
|
Nums []Style
|
|
|
|
Labels []Style
|
2015-03-20 17:35:09 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type GaugeTheme struct {
|
|
|
|
Bar Color
|
|
|
|
Label Style
|
2015-03-12 04:15:59 +08:00
|
|
|
}
|
2019-01-24 12:12:10 +08:00
|
|
|
|
|
|
|
type LineChartTheme struct {
|
|
|
|
Lines []Color
|
|
|
|
Axes Color
|
2015-09-21 15:11:58 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type ListTheme struct {
|
|
|
|
Text Style
|
2015-09-21 15:11:58 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type ParagraphTheme struct {
|
|
|
|
Text Style
|
2015-09-21 15:11:58 +08:00
|
|
|
}
|
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type PieChartTheme struct {
|
|
|
|
Slices []Color
|
|
|
|
}
|
2015-09-21 15:11:58 +08:00
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type SparklineTheme struct {
|
|
|
|
Title Style
|
|
|
|
Line Color
|
|
|
|
}
|
2015-09-21 15:11:58 +08:00
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type StackedBarChartTheme struct {
|
|
|
|
Bars []Color
|
|
|
|
Nums []Style
|
|
|
|
Labels []Style
|
|
|
|
}
|
|
|
|
|
|
|
|
type TabTheme struct {
|
|
|
|
Active Style
|
|
|
|
Inactive Style
|
|
|
|
}
|
2015-09-21 15:11:58 +08:00
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
type TableTheme struct {
|
|
|
|
Text Style
|
2015-09-21 15:11:58 +08:00
|
|
|
}
|
2016-02-05 14:20:46 +08:00
|
|
|
|
2019-01-24 12:12:10 +08:00
|
|
|
var Theme = RootTheme{
|
|
|
|
Default: NewStyle(ColorWhite),
|
|
|
|
|
|
|
|
Block: BlockTheme{
|
|
|
|
Title: NewStyle(ColorWhite),
|
|
|
|
Border: NewStyle(ColorWhite),
|
|
|
|
},
|
|
|
|
|
|
|
|
BarChart: BarChartTheme{
|
|
|
|
Bars: StandardColors,
|
|
|
|
Nums: StandardStyles,
|
|
|
|
Labels: StandardStyles,
|
|
|
|
},
|
|
|
|
|
|
|
|
Paragraph: ParagraphTheme{
|
|
|
|
Text: NewStyle(ColorWhite),
|
|
|
|
},
|
|
|
|
|
|
|
|
PieChart: PieChartTheme{
|
|
|
|
Slices: StandardColors,
|
|
|
|
},
|
|
|
|
|
|
|
|
List: ListTheme{
|
|
|
|
Text: NewStyle(ColorWhite),
|
|
|
|
},
|
|
|
|
|
|
|
|
StackedBarChart: StackedBarChartTheme{
|
|
|
|
Bars: StandardColors,
|
|
|
|
Nums: StandardStyles,
|
|
|
|
Labels: StandardStyles,
|
|
|
|
},
|
|
|
|
|
|
|
|
Gauge: GaugeTheme{
|
|
|
|
Bar: ColorWhite,
|
|
|
|
Label: NewStyle(ColorWhite),
|
|
|
|
},
|
|
|
|
|
|
|
|
Sparkline: SparklineTheme{
|
2019-01-24 13:36:58 +08:00
|
|
|
Title: NewStyle(ColorWhite),
|
|
|
|
Line: ColorWhite,
|
2019-01-24 12:12:10 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
LineChart: LineChartTheme{
|
|
|
|
Lines: StandardColors,
|
2019-01-24 13:36:58 +08:00
|
|
|
Axes: ColorWhite,
|
2019-01-24 12:12:10 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
Table: TableTheme{
|
|
|
|
Text: NewStyle(ColorWhite),
|
|
|
|
},
|
|
|
|
|
|
|
|
Tab: TabTheme{
|
|
|
|
Active: NewStyle(ColorRed),
|
|
|
|
Inactive: NewStyle(ColorWhite),
|
|
|
|
},
|
2016-02-05 14:20:46 +08:00
|
|
|
}
|