Colour codes need to be 2-wide zero padded
authorMatthew Walker <mwalker@kydance.net>
Thu, 6 Nov 2014 16:27:10 +0000 (09:27 -0700)
committerMatthew Walker <mwalker@kydance.net>
Thu, 6 Nov 2014 16:27:10 +0000 (09:27 -0700)
client/assets/plugins/textstyle.html

index 4fc54ca51e3f0e4e067dd4ea037ea0e7460e981e..fc7d495295f42d7cf3ed795a32e8888eedd65882 100644 (file)
             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) {