Skip to content

Commit

Permalink
Remove use of dark blue ANSI
Browse files Browse the repository at this point in the history
It can be hard to see in some default terminal configurations.
  • Loading branch information
Lisa Ugray committed May 23, 2018
1 parent 245cce6 commit cd90771
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/cli/ui/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Formatter
'red' => '31',
'green' => '32',
'yellow' => '33',
'blue' => '34',
# default blue is low-contrast against black in some default terminal color scheme
'blue' => '94', # 9x = high-intensity fg color x
'magenta' => '35',
'cyan' => '36',
'bold' => '1',
Expand All @@ -28,7 +29,7 @@ class Formatter
'error' => '31', # red
'success' => '32', # success
'warning' => '33', # yellow
'info' => '34', # blue
'info' => '94', # bright blue
'command' => '36', # cyan
}.freeze

Expand Down
2 changes: 1 addition & 1 deletion test/cli/ui/dex_ui_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module CLI
class UITest < MiniTest::Test
def test_resolve_test
input = "a{{blue:b {{*}}{{bold:c {{red:d}}}}{{bold: e}}}} f"
expected = "\e[0ma\e[0;34mb \e[0;33m⭑\e[0;34;1mc \e[0;34;1;31md\e[0;34;1m e\e[0m f"
expected = "\e[0ma\e[0;94mb \e[0;33m⭑\e[0;94;1mc \e[0;94;1;31md\e[0;94;1m e\e[0m f"
actual = CLI::UI.resolve_text(input)
assert_equal(expected, actual)
end
Expand Down
4 changes: 2 additions & 2 deletions test/cli/ui/formatter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module UI
class FormatterTest < MiniTest::Test
def test_format
input = "a{{blue:b {{*}}{{bold:c {{red:d}}}}{{bold: e}}}} f"
expected = "\e[0ma\e[0;34mb \e[0;33m⭑\e[0;34;1mc \e[0;34;1;31md\e[0;34;1m e\e[0m f"
expected = "\e[0ma\e[0;94mb \e[0;33m⭑\e[0;94;1mc \e[0;94;1;31md\e[0;94;1m e\e[0m f"
actual = CLI::UI::Formatter.new(input).format
assert_equal(expected, actual)
end
Expand All @@ -19,7 +19,7 @@ def test_format_no_color

def test_format_trailing
input = "a{{bold:a {{blue:"
expected = "\e[0ma\e[0;1ma \e[0;1;34m"
expected = "\e[0ma\e[0;1ma \e[0;1;94m"
actual = CLI::UI::Formatter.new(input).format
assert_equal(expected, actual)
end
Expand Down

0 comments on commit cd90771

Please sign in to comment.