Adapt label color to median grade.

This is a cheap implementation that will probably need a rewrite
for complete support of other gradations.
mj-v1.12
domi41 4 years ago
parent 55724282a6
commit b31fbb9879

@ -43,5 +43,20 @@ func (result *PollResult) GetCandidate(candidateID int64) (_ *PollCandidateResul
}
func (result *PollCandidateResult) GetColorWord() (_ string) {
return "red" // FIXME
switch result.MedianGrade {
case 0:
return "red"
case 1:
return "red"
case 2:
return "orange"
case 3:
return "yellow"
case 4:
return "olive"
case 5:
return "green"
default:
return "green"
}
}

Loading…
Cancel
Save