diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-03-20 20:26:24 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-03-20 20:26:24 +0000 |
commit | 3224bb3f77ec387ab75c09c5090db58d9be8f938 (patch) | |
tree | 9ed438f659fb7274e6d8b160a570a412ef6b7e5f /stand/lua | |
parent | 8fbcc3343fff1404b8a5d11d2516e94965ca7be1 (diff) | |
download | src-3224bb3f77ec387ab75c09c5090db58d9be8f938.tar.gz src-3224bb3f77ec387ab75c09c5090db58d9be8f938.zip |
Notes
Diffstat (limited to 'stand/lua')
-rw-r--r-- | stand/lua/color.lua | 16 | ||||
-rw-r--r-- | stand/lua/menu.lua | 4 |
2 files changed, 17 insertions, 3 deletions
diff --git a/stand/lua/color.lua b/stand/lua/color.lua index 8aa9fe25eba3..88a4798fa094 100644 --- a/stand/lua/color.lua +++ b/stand/lua/color.lua @@ -65,6 +65,13 @@ function color.escapef(color_value) return core.KEYSTR_CSI .. "3" .. color_value .. "m" end +function color.resetf() + if color.disabled then + return '' + end + return core.KEYSTR_CSI .. "39m" +end + function color.escapeb(color_value) if color.disabled then return color_value @@ -72,6 +79,13 @@ function color.escapeb(color_value) return core.KEYSTR_CSI .. "4" .. color_value .. "m" end +function color.resetb() + if color.disabled then + return '' + end + return core.KEYSTR_CSI .. "49m" +end + function color.escape(fg_color, bg_color, attribute) if color.disabled then return "" @@ -98,7 +112,7 @@ function color.highlight(str) end -- We need to reset attributes as well as color scheme here, just in -- case the terminal defaults don't match what we're expecting. - return core.KEYSTR_CSI .. "1m" .. str .. color.default() + return core.KEYSTR_CSI .. "1m" .. str .. core.KEYSTR_CSI .. "22m" end return color diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index a98b0b3ce328..e0979a2c5a5d 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -120,7 +120,7 @@ menu.boot_environments = { name_color = color.escapef(color.BLUE) end bootenv_name = bootenv_name .. name_color .. - choice .. color.default() + choice .. color.resetf() return color.highlight("A").."ctive: " .. bootenv_name .. " (" .. idx .. " of " .. #all_choices .. ")" @@ -306,7 +306,7 @@ menu.welcome = { name_color = color.escapef(color.BLUE) end kernel_name = kernel_name .. name_color .. - choice .. color.default() + choice .. color.resetf() return color.highlight("K") .. "ernel: " .. kernel_name .. " (" .. idx .. " of " .. #all_choices .. ")" |