From 770a126529fc6bd1dac4ff8372593b8f1fa01564 Mon Sep 17 00:00:00 2001 From: Matthew Walker Date: Thu, 6 Nov 2014 09:27:10 -0700 Subject: [PATCH] Colour codes need to be 2-wide zero padded --- client/assets/plugins/textstyle.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/assets/plugins/textstyle.html b/client/assets/plugins/textstyle.html index 4fc54ca..fc7d495 100644 --- a/client/assets/plugins/textstyle.html +++ b/client/assets/plugins/textstyle.html @@ -121,7 +121,13 @@ var style_codes = ''; if (styles.colour !== false) { - style_codes += String.fromCharCode(3) + styles.colour.toString(); + var colour_code = styles.colour.toString(); + + if (styles.colour < 10) { + colour_code = '0' + colour_code; + } + + style_codes += String.fromCharCode(3) + color_code; } if (styles.bold) { -- 2.25.1