From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 01/21] test: Add bash lib for colors Date: Mon, 20 May 2024 11:05:51 +0200 Message-ID: <20240520090611.10406-2-jonatan.schlag@ipfire.org> In-Reply-To: <20240520090611.10406-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5804582335988155906==" List-Id: --===============5804582335988155906== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is borrowed from here: https://git.ipfire.org/?p=3Dnetwork.git;a=3Dblob;= f=3Dsrc/functions/functions.colors;h=3D0bd6f97177c366f1d1ee4553043ae719430acd= b2;hb=3Drefs/heads/master Signed-off-by: Jonatan Schlag --- tests/lib_color.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/lib_color.sh diff --git a/tests/lib_color.sh b/tests/lib_color.sh new file mode 100644 index 000000000..6ca1c9864 --- /dev/null +++ b/tests/lib_color.sh @@ -0,0 +1,43 @@ +#!/usr/bin/bash + +# Regular colours +CLR_BLACK_R=3D'\e[0;30m' +CLR_RED_R=3D'\e[0;31m' +CLR_GREEN_R=3D'\e[0;32m' +CLR_YELLOW_R=3D'\e[0;33m' +CLR_BLUE_R=3D'\e[0;34m' +CLR_PURPLE_R=3D'\e[0;35m' +CLR_CYAN_R=3D'\e[0;36m' +CLR_WHITE_R=3D'\e[0;37m' + +# Bold colours +CLR_BLACK_B=3D'\e[1;30m' +CLR_RED_B=3D'\e[1;31m' +CLR_GREEN_B=3D'\e[1;32m' +CLR_YELLOW_B=3D'\e[1;33m' +CLR_BLUE_B=3D'\e[1;34m' +CLR_PURPLE_B=3D'\e[1;35m' +CLR_CYAN_B=3D'\e[1;36m' +CLR_WHITE_B=3D'\e[1;37m' + +# Background colors +CLR_BLACK_BG=3D'\e[40m' +CLR_RED_BG=3D'\e[41m' +CLR_GREEN_BG=3D'\e[42m' +CLR_YELLOW_BG=3D'\e[43m' +CLR_BLUE_BG=3D'\e[44m' +CLR_PURPLE_BG=3D'\e[45m' +CLR_CYAN_BG=3D'\e[46m' +CLR_WHITE_BG=3D'\e[47m' + +# Font decoration +FONT_RESET=3D"\e[0m" +FONT_BOLD=3D"\e[1m" +FONT_UNDERLINED=3D"\e[4m" +FONT_BLINKING=3D"\e[5m" +FONT_INVERTED=3D"\e[7m" + +# Reset everything +CLR_RESET=3D"${FONT_RESET}" + + --=20 2.39.2 --===============5804582335988155906==--