From 58228834fc2aa12643dedf73168e48b688b44d4a Mon Sep 17 00:00:00 2001 From: Jack Morris Date: Mon, 15 Apr 2019 17:03:49 +0100 Subject: [PATCH] Allow users to choose color Change boolean in config yaml to 'successBallColor' which allows users to choose their own if they wish --- modules/jenkins/widget.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/jenkins/widget.go b/modules/jenkins/widget.go index 707d0b80..c4446744 100644 --- a/modules/jenkins/widget.go +++ b/modules/jenkins/widget.go @@ -120,9 +120,10 @@ func (widget *Widget) rowColor(idx int) string { func (widget *Widget) jobColor(job *Job) string { switch job.Color { case "blue": - // Override color if greenBalls boolean param provided in config - if wtf.Config.UString("wtf.mods.jenkins.greenBalls") == "true" { - return "green" + // Override color if successBallColor boolean param provided in config + ballColor := wtf.Config.UString("wtf.mods.jenkins.successBallColor", "blue") + if ballColor != "blue" { + return ballColor } else { return "blue" }