33
33
{ID : "type" , Name : "Type" , SortIndex : 10 },
34
34
{ID : "filesystem" , Name : "Filesystem" , SortIndex : 11 },
35
35
}
36
-
37
- colorRed = term .Color ("#E88388" )
38
- colorYellow = term .Color ("#DBAB79" )
39
- colorGreen = term .Color ("#A8CC8C" )
40
- colorBlue = term .Color ("#71BEF2" )
41
- colorGray = term .Color ("#B9BFCA" )
42
- colorMagenta = term .Color ("#D290E4" )
43
- colorCyan = term .Color ("#66C2CD" )
44
36
)
45
37
46
38
// printTable prints an individual table of mounts.
@@ -103,7 +95,7 @@ func printTable(title string, m []Mount, sortBy int, cols []int) {
103
95
}
104
96
105
97
tab .AppendRow ([]interface {}{
106
- termenv .String (v .Mountpoint ).Foreground (colorBlue ), // mounted on
98
+ termenv .String (v .Mountpoint ).Foreground (theme . colorBlue ), // mounted on
107
99
v .Total , // size
108
100
v .Used , // used
109
101
v .Free , // avail
@@ -112,8 +104,8 @@ func printTable(title string, m []Mount, sortBy int, cols []int) {
112
104
v .InodesUsed , // inodes used
113
105
v .InodesFree , // inodes avail
114
106
inodeUsage , // inodes use%
115
- termenv .String (v .Fstype ).Foreground (colorGray ), // type
116
- termenv .String (v .Device ).Foreground (colorGray ), // filesystem
107
+ termenv .String (v .Fstype ).Foreground (theme . colorGray ), // type
108
+ termenv .String (v .Device ).Foreground (theme . colorGray ), // filesystem
117
109
v .Total , // size sorting helper
118
110
v .Used , // used sorting helper
119
111
v .Free , // avail sorting helper
@@ -157,11 +149,11 @@ func spaceTransformer(val interface{}) string {
157
149
var s = termenv .String (sizeToString (free ))
158
150
switch {
159
151
case free < 1 << 30 :
160
- s = s .Foreground (colorRed )
152
+ s = s .Foreground (theme . colorRed )
161
153
case free < 10 * 1 << 30 :
162
- s = s .Foreground (colorYellow )
154
+ s = s .Foreground (theme . colorYellow )
163
155
default :
164
- s = s .Foreground (colorGreen )
156
+ s = s .Foreground (theme . colorGreen )
165
157
}
166
158
167
159
return s .String ()
@@ -187,11 +179,11 @@ func barTransformer(val interface{}) string {
187
179
// apply color to progress-bar
188
180
switch {
189
181
case usage >= 0.9 :
190
- s = s .Foreground (colorRed )
182
+ s = s .Foreground (theme . colorRed )
191
183
case usage >= 0.5 :
192
- s = s .Foreground (colorYellow )
184
+ s = s .Foreground (theme . colorYellow )
193
185
default :
194
- s = s .Foreground (colorGreen )
186
+ s = s .Foreground (theme . colorGreen )
195
187
}
196
188
197
189
return s .String ()
0 commit comments