Created
April 18, 2017 10:38
-
-
Save tiehuis/15f6a85c1b8fe691008c10b4d325a7c3 to your computer and use it in GitHub Desktop.
quick rg color test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
echo -e "\n256-color approximation\n" | |
for i in `seq 0 255`; do | |
printf "\x1b[48;5;${i}m \x1b[0m - " | |
./target/debug/rg 'door-m' grep/src/data/sherlock.txt --colors "match:bg:$i" --colors "match:fg:$i" --only-matching -N | |
done | |
echo -e "\nTrue-color approximation\n" | |
for r in `seq 0 7`; do | |
for g in `seq 0 7`; do | |
for b in `seq 0 7`; do | |
((_r=32*r)) | |
((_g=32*g)) | |
((_b=32*b)) | |
printf "\x1b[48;2;${_r};${_g};${_b}m \x1b[0m - " | |
./target/debug/rg 'door-m' grep/src/data/sherlock.txt --colors "match:bg:${_r},${_g},${_b}" --colors "match:fg:${_r},${_g},${_b}" --only-matching -N | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment