home · contact · privacy
Fix color setting bug.
[plomrogue2] / rogue_chat.html
index 17747ff55462b67c66337727ad51d67d02f55b2e..0a70962a0d72e30218980101b90ecea16736789d 100644 (file)
@@ -286,7 +286,7 @@ let terminal = {
   },
   set_random_colors: function() {
       function rand(offset) {
-          return Math.floor(offset + Math.random() * 96).toString(16);
+          return Math.floor(offset + Math.random() * 96).toString(16).padStart(2, '0');
       }
       this.foreground = '#' + rand(159) + rand(159) + rand(159);
       this.background = '#' + rand(0) + rand(0) + rand(0);