aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/color.lua
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-02-26 04:08:54 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-02-26 04:08:54 +0000
commit04af422907599825aa89cce0399932835d414103 (patch)
tree975f6d18386e76dec3e77e1280a2bb5a7109e8b5 /stand/lua/color.lua
parent2a11b810906a920784501ec3fbf0c5da41b941dd (diff)
Notes
Diffstat (limited to 'stand/lua/color.lua')
-rw-r--r--stand/lua/color.lua23
1 files changed, 12 insertions, 11 deletions
diff --git a/stand/lua/color.lua b/stand/lua/color.lua
index ea8760b67425..e5be3948a8f4 100644
--- a/stand/lua/color.lua
+++ b/stand/lua/color.lua
@@ -58,30 +58,31 @@ end
color.disabled = not color.isEnabled()
-function color.escapef(c)
+function color.escapef(color_value)
if color.disabled then
- return c
+ return color_value
end
- return "\027[3" .. c .. "m"
+ return "\027[3" .. color_value .. "m"
end
-function color.escapeb(c)
+function color.escapeb(color_value)
if color.disabled then
- return c
+ return color_value
end
- return "\027[4" .. c .. "m"
+ return "\027[4" .. color_value .. "m"
end
-function color.escape(fg, bg, att)
+function color.escape(fg_color, bg_color, attribute)
if color.disabled then
return ""
end
- if not att then
- att = ""
+ if attribute == nil then
+ attribute = ""
else
- att = att .. ";"
+ attribute = attribute .. ";"
end
- return "\027[" .. att .. "3" .. fg .. ";4" .. bg .. "m"
+ return "\027[" .. attribute ..
+ "3" .. fg_color .. ";4" .. bg_color .. "m"
end
function color.default()