Skip to content

Instantly share code, notes, and snippets.

@max-cx
Forked from jcyamo/colorscheme-text
Created November 19, 2022 13:14
Show Gist options
  • Save max-cx/0ef09e86a6fc276eb10e407856dcad58 to your computer and use it in GitHub Desktop.
Save max-cx/0ef09e86a6fc276eb10e407856dcad58 to your computer and use it in GitHub Desktop.
Script for echoing hex values of current term colors
#!/bin/bash
colors=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
echo -e "\e[1;37m
Black Red Green Yellow Blue Magenta Cyan White
──────────────────────────────────────────────────────────────────────\e[0m"
for i in {0..7}; do echo -en "\e[$((30+$i))m ${colors[i]} \e[0m"; done
echo
for i in {8..15}; do echo -en "\e[1;$((22+$i))m ${colors[i]} \e[0m"; done
echo -e "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment