From 016ca7ff66e0ba232e2913560765d076f7b49d46 Mon Sep 17 00:00:00 2001 From: Lisa Ugray Date: Wed, 23 May 2018 13:18:25 -0400 Subject: [PATCH] Remove use of dark blue ANSI It can be hard to see in some default terminal configurations. --- lib/cli/ui/formatter.rb | 5 +++-- test/cli/ui/dex_ui_test.rb | 2 +- test/cli/ui/formatter_test.rb | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/cli/ui/formatter.rb b/lib/cli/ui/formatter.rb index e48f545f..f364e4ff 100644 --- a/lib/cli/ui/formatter.rb +++ b/lib/cli/ui/formatter.rb @@ -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', @@ -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 diff --git a/test/cli/ui/dex_ui_test.rb b/test/cli/ui/dex_ui_test.rb index a5a20cbf..cbbe7627 100644 --- a/test/cli/ui/dex_ui_test.rb +++ b/test/cli/ui/dex_ui_test.rb @@ -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 diff --git a/test/cli/ui/formatter_test.rb b/test/cli/ui/formatter_test.rb index 9f4dd5d6..e21bb668 100644 --- a/test/cli/ui/formatter_test.rb +++ b/test/cli/ui/formatter_test.rb @@ -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 @@ -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