From d1fac5df1df6ddedfd62aea9ffdc0d0161cd1597 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Mon, 12 Apr 2021 22:00:09 -0500 Subject: [PATCH] Allow rgb truecolors to be passed to --ascii_color --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index 62b82ea4c..0407de2c4 100755 --- a/neofetch +++ b/neofetch @@ -4628,6 +4628,12 @@ color() { case $1 in [0-6]) printf '%b\e[3%sm' "$reset" "$1" ;; 7 | "fg") printf '\e[37m%b' "$reset" ;; + "#"*) + local rgb="${1//#}" + rgb="$((0x$rgb))" + printf '\e[38;2;%b;%b;%bm' "$(($rgb >> 16))" "$((($rgb >> 8) & 0xff))" "$(($rgb & 0xff))" + ;; + *) printf '\e[38;5;%bm' "$1" ;; esac }