Skip to content

Commit 60c2d66

Browse files
jakubsachatsenart
authored andcommitted
Make plot use more diverse colors
Signed-off-by: Tomás Senart <tsenart@gmail.com>
1 parent eedbf47 commit 60c2d66

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/plot/plot.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (p Plot) WriteTo(w io.Writer) (n int64, err error) {
241241
}
242242

243243
var (
244-
reds = []string{
244+
failures = []string{
245245
"#EE7860",
246246
"#DD624E",
247247
"#CA4E3E",
@@ -250,29 +250,29 @@ var (
250250
"#881618",
251251
"#6F050E",
252252
}
253-
greens = []string{
254-
"#A6DA83",
255-
"#84C068",
256-
"#64A550",
257-
"#488A3A",
258-
"#2F7027",
259-
"#185717",
260-
"#053E0A",
253+
successes = []string{
254+
"#E9D758",
255+
"#297373",
256+
"#39393A",
257+
"#A1CDF4",
258+
"#593C8F",
259+
"#171738",
260+
"#A1674A",
261261
}
262262
)
263263

264264
func labelColors(labels []string) []string {
265265
colors := make([]string, 0, len(labels))
266266

267-
var red, green int
267+
var failure, success int
268268
for _, label := range labels {
269269
var color string
270270
if strings.Contains(label, "ERROR") {
271-
color = reds[red%len(reds)]
272-
red++
271+
color = failures[failure%len(failures)]
272+
failure++
273273
} else {
274-
color = greens[green%len(greens)]
275-
green++
274+
color = successes[success%len(successes)]
275+
success++
276276
}
277277
colors = append(colors, color)
278278
}

0 commit comments

Comments
 (0)