From 0f789b39196970c247ea7b7d06433230a7a9e3c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrej=20Petrovi=C4=87?= <7419746+andrejp88@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:03:59 +0100 Subject: [PATCH] Add a theme based on the 16 base ANSI colors --- src/cb/src/themes.cpp | 12 ++++++++++++ src/tests/themes.sh | 2 ++ 2 files changed, 14 insertions(+) mode change 100644 => 100755 src/tests/themes.sh diff --git a/src/cb/src/themes.cpp b/src/cb/src/themes.cpp index 2673bf4e6..d402b643d 100644 --- a/src/cb/src/themes.cpp +++ b/src/cb/src/themes.cpp @@ -75,5 +75,17 @@ void setTheme(const std::string_view& theme) { {"[inverse]", "\033[7m"}, {"[noinverse]", "\033[27m"}, {"[blank]", "\033[0m"}}}; + } else if (theme == "ansi") { + colors = { + {{"[error]", "\033[38;5;1m"}, + {"[success]", "\033[38;5;2m"}, + {"[progress]", "\033[38;5;3m"}, + {"[info]", "\033[38;5;4m"}, + {"[help]", "\033[38;5;5m"}, + {"[bold]", "\033[1m"}, + {"[nobold]", "\033[22m"}, + {"[inverse]", "\033[7m"}, + {"[noinverse]", "\033[27m"}, + {"[blank]", "\033[0m"}}}; } } \ No newline at end of file diff --git a/src/tests/themes.sh b/src/tests/themes.sh old mode 100644 new mode 100755 index 50142ae67..8dc966c63 --- a/src/tests/themes.sh +++ b/src/tests/themes.sh @@ -17,6 +17,8 @@ CLIPBOARD_THEME=lighthighcontrast cb copy testfile testdir CLIPBOARD_THEME=darkhighcontrast cb copy testfile testdir +CLIPBOARD_THEME=ansi cb copy testfile testdir + NO_COLOR=1 cb copy testfile testdir NO_COLOR=1 FORCE_COLOR=1 cb copy testfile testdir \ No newline at end of file