summaryrefslogtreecommitdiffstats
path: root/colorschemes
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-06-07 16:40:03 -0500
committerSean E. Russell <ser@ser1.net>2020-06-07 16:56:19 -0500
commitb20f47738953c9f2a1c3e483976104bc3cbfcbba (patch)
tree192ea9d205d8e3c041c8b31d865e8364cb0a4b6f /colorschemes
parentb13fd2833c081d6d187b80d7d43f358e9e7d2009 (diff)
linting & documentationv4.0.0
Updated versioning and dates for release.
Diffstat (limited to 'colorschemes')
-rw-r--r--colorschemes/registry.go3
-rw-r--r--colorschemes/template.go54
2 files changed, 41 insertions, 16 deletions
diff --git a/colorschemes/registry.go b/colorschemes/registry.go
index d120eb8..baa4bda 100644
--- a/colorschemes/registry.go
+++ b/colorschemes/registry.go
@@ -17,6 +17,9 @@ func init() {
}
}
+// FromName loads a Colorscheme by name; confDir is used to search
+// directories for a scheme matching the name. The search order
+// is the same as for config files.
func FromName(confDir configdir.ConfigDir, c string) (Colorscheme, error) {
if cs, ok := registry[c]; ok {
return cs, nil
diff --git a/colorschemes/template.go b/colorschemes/template.go
index af4b792..514a063 100644
--- a/colorschemes/template.go
+++ b/colorschemes/template.go
@@ -1,46 +1,68 @@
package colorschemes
-/*
- The standard 256 terminal colors are supported.
-
- -1 = clear
-
- You can combine a color with 'Bold', 'Underline', or 'Reverse' by using bitwise OR ('|') and the name of the Color.
- For example, to get Bold red Labels, you would do 'Labels: 2 | Bold'.
-
- Once you've created a colorscheme, add an entry for it in the `handleColorscheme` function in 'main.go'.
-*/
-
+//revive:disable
const (
Bold int = 1 << (iota + 9)
Underline
Reverse
)
+//revive:enable
+
+/*
+Colorscheme defines colors and fonts used by TUI elements. The standard
+256 terminal colors are supported.
+
+For int values, -1 = clear
+
+Colors may be combined with 'Bold', 'Underline', or 'Reverse' by using
+bitwise OR ('|') and the name of the Color. For example, to get bold red
+labels, you would use 'Labels: 2 | Bold'
+*/
type Colorscheme struct {
- Name string
+ // Name is the key used to look up the colorscheme, e.g. as provided by the user
+ Name string
+ // Who created the color scheme
Author string
+ // Foreground color
Fg int
+ // Background color
Bg int
+ // BorderLabel is the color of the widget title label
BorderLabel int
- BorderLine int
+ // BorderLine is the color of the widget border
+ BorderLine int
- // should add at least 8 here
+ // CPULines define the colors used for the CPU activity graph, in
+ // order, for each core. Should add at least 8 here; they're
+ // selected in order, with wrapping.
CPULines []int
+ // BattLines define the colors used for the battery history graph.
+ // Should add at least 2; they're selected in order, with wrapping.
BattLines []int
+ // MemLines define the colors used for the memory histograph.
+ // Should add at least 2 (physical & swap); they're selected in order,
+ // with wrapping.
MemLines []int
+ // ProcCursor is used as the color for the color bar in the process widget
ProcCursor int
+ // SparkLine determines the color of the data line in spark graphs
Sparkline int
+ // DiskBar is the color of the disk gauge bars (currently unused,
+ // as there's no disk gauge widget)
DiskBar int
- // colors the temperature number a different color if it's over a certain threshold
- TempLow int
+ // TempLow determines the color of the temperature number when it's under
+ // a certain threshold
+ TempLow int
+ // TempHigh determines the color of the temperature number when it's over
+ // a certain threshold
TempHigh int
}