1" Script to generate a file that shows al 256 xterm colors 2 3new 4let lnum = 1 5 6" | in original color pair to see white background. 7let trail_bar = "\033[m|" 8 9" ANSI colors 10call setline(lnum, 'ANSI background') 11let lnum += 1 12 13let s = '' 14for nr in range(0, 7) 15 let s .= "\033[4" . nr . "m " 16endfor 17for nr in range(8, 15) 18 let s .= "\033[10" . (nr - 8) . "m " 19endfor 20let s .= trail_bar 21 22call setline(lnum, s) 23let lnum += 1 24 25" ANSI text colors 26call setline(lnum, 'ANSI text') 27let lnum += 1 28 29let s = '' 30for nr in range(0, 7) 31 let s .= "\033[0;3" . nr . "mxxxx" 32endfor 33for nr in range(8, 15) 34 let s .= "\033[0;9" . (nr - 8) . "mxxxx" 35endfor 36let s .= trail_bar 37 38call setline(lnum, s) 39let lnum += 1 40 41" ANSI with bold text 42call setline(lnum, 'ANSI bold text') 43let lnum += 1 44 45let s = '' 46for nr in range(0, 7) 47 let s .= "\033[1;3" . nr . "mxxxx" 48endfor 49for nr in range(8, 15) 50 let s .= "\033[1;9" . (nr - 8) . "mxxxx" 51endfor 52let s .= trail_bar 53 54call setline(lnum, s) 55let lnum += 1 56 57" 6 x 6 x 6 color cube 58call setline(lnum, 'color cube') 59let lnum += 1 60 61for high in range(0, 5) 62 let s = '' 63 for low in range(0, 35) 64 let nr = low + high * 36 65 let s .= "\033[48;5;" . (nr + 16) . "m " 66 endfor 67 let s .= trail_bar 68 call setline(lnum + high, s) 69endfor 70let lnum += 6 71 72" 24 shades of grey 73call setline(lnum, 'grey ramp') 74let lnum += 1 75 76let s = '' 77for nr in range(0, 23) 78 let s .= "\033[48;5;" . (nr + 232) . "m " 79endfor 80let s .= trail_bar 81call setline(lnum, s) 82 83set binary 84write! <sfile>:h/color_ramp.txt 85quit 86