256-colors.sh
· 623 B · Bash
Ham
#!/bin/bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
for fgbg in 38 48 ; do #Foreground/Background
for color in {0..256} ; do #Colors
#Display the color
echo -en "\e[${fgbg};5;${color}m ${color}\t\e[0m"
#Display 10 colors per lines
if [ $((($color + 1) % 10)) == 0 ] ; then
echo #New line
fi
done
echo #New line
done
exit 0
| 1 | #!/bin/bash |
| 2 | |
| 3 | # This program is free software. It comes without any warranty, to |
| 4 | # the extent permitted by applicable law. You can redistribute it |
| 5 | # and/or modify it under the terms of the Do What The Fuck You Want |
| 6 | # To Public License, Version 2, as published by Sam Hocevar. See |
| 7 | # http://sam.zoy.org/wtfpl/COPYING for more details. |
| 8 | |
| 9 | for fgbg in 38 48 ; do #Foreground/Background |
| 10 | for color in {0..256} ; do #Colors |
| 11 | #Display the color |
| 12 | echo -en "\e[${fgbg};5;${color}m ${color}\t\e[0m" |
| 13 | #Display 10 colors per lines |
| 14 | if [ $((($color + 1) % 10)) == 0 ] ; then |
| 15 | echo #New line |
| 16 | fi |
| 17 | done |
| 18 | echo #New line |
| 19 | done |
| 20 | |
| 21 | exit 0 |