Changeset

10423:317bcc4f25f5

util.termcolours: Use explicit number formatting instead of coercion on concatenation
author Kim Alvefur <zash@zash.se>
date Wed, 20 Nov 2019 19:22:55 +0100
parents 10422:cb6c0a5f9367
children 10424:e7d3fa49495f
files util/termcolours.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/termcolours.lua	Tue Nov 19 17:38:38 2019 +0100
+++ b/util/termcolours.lua	Wed Nov 20 19:22:55 2019 +0100
@@ -83,7 +83,7 @@
 setmetatable(stylemap, { __index = function(_, style)
 	if type(style) == "string" and style:find("%x%x%x%x%x%x") == 1 then
 		local g = style:sub(7) == " background" and "48;5;" or "38;5;";
-		return g .. color(hex2rgb(style));
+		return format("%s%d", g, color(hex2rgb(style)));
 	end
 end } );