Misc updates to bin/colortest
This commit is contained in:
		
							parent
							
								
									bca8425025
								
							
						
					
					
						commit
						0c9c8d0828
					
				
					 1 changed files with 27 additions and 8 deletions
				
			
		|  | @ -1,17 +1,31 @@ | ||||||
| #!/usr/bin/env zsh | #!/usr/bin/env zsh | ||||||
| 
 | 
 | ||||||
|  | function print_color | ||||||
|  | { | ||||||
|  |     #local formatted=`printf "%4d " $1` | ||||||
|  |     local formatted="     " | ||||||
|  |     print -Pn "%K{$1}${formatted}%k" | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
|  | print -n '        ' | ||||||
|  | for (( i = 0; i < 8; i += 1 )); do | ||||||
|  |     printf "%4d " $i | ||||||
|  | done | ||||||
|  | print | ||||||
| print -n 'Normal: ' | print -n 'Normal: ' | ||||||
| for (( i = 1; i <= 8; i += 1 )); do | for (( i = 0; i < 8; i += 1 )); do | ||||||
|     formattedi=`printf "%3d" $i` |     print_color $i | ||||||
|     print -Pn "%K{$i}${formattedi}%k" |  | ||||||
| done | done | ||||||
| print | print | ||||||
| 
 | 
 | ||||||
|  | print -n '        ' | ||||||
|  | for (( i = 8; i < 16; i += 1 )); do | ||||||
|  |     printf "%4d " $i | ||||||
|  | done | ||||||
|  | print | ||||||
| print -n 'Bright: ' | print -n 'Bright: ' | ||||||
| for (( i = 9; i <= 16; i += 1 )); do | for (( i = 8; i < 16; i += 1 )); do | ||||||
|     formattedi=`printf "%3d" $i` |     print_color $i | ||||||
|     print -Pn "%K{$i}${formattedi}$k" |  | ||||||
| done | done | ||||||
| print | print | ||||||
| 
 | 
 | ||||||
|  | @ -23,8 +37,13 @@ print "Color Table ($SUPPORTED_COLORS supported colors)" | ||||||
| 
 | 
 | ||||||
| for (( base = 0; base < $SUPPORTED_COLORS ; base += $COLORS_PER_LINE )); do | for (( base = 0; base < $SUPPORTED_COLORS ; base += $COLORS_PER_LINE )); do | ||||||
|     for (( i = base; i < base + $COLORS_PER_LINE && i < $SUPPORTED_COLORS; i += 1 )); do |     for (( i = base; i < base + $COLORS_PER_LINE && i < $SUPPORTED_COLORS; i += 1 )); do | ||||||
|         formattedi=`printf "%4d" $i` |         printf "%4d " $i | ||||||
|         print -Pn "%K{$i}${formattedi}%k" |     done | ||||||
|  | 
 | ||||||
|  |     print | ||||||
|  | 
 | ||||||
|  |     for (( i = base; i < base + $COLORS_PER_LINE && i < $SUPPORTED_COLORS; i += 1 )); do | ||||||
|  |         print_color $i | ||||||
|     done |     done | ||||||
|     print |     print | ||||||
| done | done | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue