Mercurial > prosody-hg
comparison util/termcolours.lua @ 11200:bf8f2da84007
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 05 Nov 2020 22:31:25 +0100 |
| parents | 317bcc4f25f5 |
| children | d10957394a3c |
comparison
equal
deleted
inserted
replaced
| 11199:6c7c50a4de32 | 11200:bf8f2da84007 |
|---|---|
| 81 end | 81 end |
| 82 | 82 |
| 83 setmetatable(stylemap, { __index = function(_, style) | 83 setmetatable(stylemap, { __index = function(_, style) |
| 84 if type(style) == "string" and style:find("%x%x%x%x%x%x") == 1 then | 84 if type(style) == "string" and style:find("%x%x%x%x%x%x") == 1 then |
| 85 local g = style:sub(7) == " background" and "48;5;" or "38;5;"; | 85 local g = style:sub(7) == " background" and "48;5;" or "38;5;"; |
| 86 return g .. color(hex2rgb(style)); | 86 return format("%s%d", g, color(hex2rgb(style))); |
| 87 end | 87 end |
| 88 end } ); | 88 end } ); |
| 89 | 89 |
| 90 local csscolors = { | 90 local csscolors = { |
| 91 red = "ff0000"; fuchsia = "ff00ff"; green = "008000"; white = "ffffff"; | 91 red = "ff0000"; fuchsia = "ff00ff"; green = "008000"; white = "ffffff"; |
