From cbaa97d8c38bf7bc1a92480ae83e323e1e0cac02 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Sat, 23 Jul 2011 10:42:43 -0400 Subject: [PATCH] Add utility method to spectrum --- lib/spectrum.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 4006a7fe1..2fdf537ef 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -18,3 +18,11 @@ for color in {000..255}; do FG[$color]="%{[38;5;${color}m%}" BG[$color]="%{[48;5;${color}m%}" done + +# Show all 256 colors with color number +function spectrum_ls() { + for code in {000..255}; do + print -P -- "$code: %F{$code}Test%f" + done +} +