Skip to content

Commit

Permalink
Allow rgb truecolors to be passed to --ascii_color
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed Apr 13, 2021
1 parent 6dd85d6 commit d1fac5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d1fac5d

Please sign in to comment.