spectrum.zsh 614 B

1234567891011121314151617181920
  1. #! /bin/zsh
  2. # A script to make using 256 colors in zsh less painful.
  3. # P.C. Shyamshankar <sykora@lucentbeing.com>
  4. # Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
  5. typeset -Ag FX FG BG
  6. FX=(
  7. reset "%{%}"
  8. bold "%{%}" no-bold "%{%}"
  9. italic "%{%}" no-italic "%{%}"
  10. underline "%{%}" no-underline "%{%}"
  11. blink "%{%}" no-blink "%{%}"
  12. reverse "%{%}" no-reverse "%{%}"
  13. )
  14. for color in {000..255}; do
  15. FG[$color]="%{[38;5;${color}m%}"
  16. BG[$color]="%{[48;5;${color}m%}"
  17. done