diff --git a/qa/ui/src/lib/teams.js b/qa/ui/src/lib/teams.js index c39c2409..2db94a36 100644 --- a/qa/ui/src/lib/teams.js +++ b/qa/ui/src/lib/teams.js @@ -22,11 +22,14 @@ export class Team { toHexColor() { let num = this.color; num >>>= 0; - let b = num & 0xFF, - g = (num & 0xFF00) >>> 8, - r = (num & 0xFF0000) >>> 16, + let b = (num & 0xFF).toString(16), + g = ((num & 0xFF00) >>> 8).toString(16), + r = ((num & 0xFF0000) >>> 16).toString(16), a = ( (num & 0xFF000000) >>> 24 ) / 255 ; - return "#" + r.toString(16) + g.toString(16) + b.toString(16); + if (r.length <= 1) r = "0" + r; + if (g.length <= 1) g = "0" + g; + if (b.length <= 1) b = "0" + b; + return "#" + r + g + b; } }