Allow rgb truecolors to be passed to --ascii_color
This commit is contained in:
parent
6dd85d67fc
commit
d1fac5df1d
1 changed files with 6 additions and 0 deletions
6
neofetch
6
neofetch
|
@ -4628,6 +4628,12 @@ color() {
|
||||||
case $1 in
|
case $1 in
|
||||||
[0-6]) printf '%b\e[3%sm' "$reset" "$1" ;;
|
[0-6]) printf '%b\e[3%sm' "$reset" "$1" ;;
|
||||||
7 | "fg") printf '\e[37m%b' "$reset" ;;
|
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" ;;
|
*) printf '\e[38;5;%bm' "$1" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue