Skip to content

Instantly share code, notes, and snippets.

@tiehuis
Created April 18, 2017 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiehuis/15f6a85c1b8fe691008c10b4d325a7c3 to your computer and use it in GitHub Desktop.
Save tiehuis/15f6a85c1b8fe691008c10b4d325a7c3 to your computer and use it in GitHub Desktop.
quick rg color test
#!/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