You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

colortest 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. #!/usr/bin/perl
  2. # by entheon, do whatever the hell you want with this file
  3. print "\n";
  4. print "**************************\n";
  5. print "*XTERM 256Color Test Chart\n";
  6. print "**************************\n";
  7. print "* 16 = black\n";
  8. print "* 255 = white\n";
  9. print "*\n";
  10. print "* Usage:\n";
  11. print "* colortest -w\n";
  12. print "* wide display\n";
  13. print "*\n";
  14. print "* colortest -w -r\n";
  15. print "* wide display reversed\n";
  16. print "*\n";
  17. print "* colortest -w -s\n";
  18. print "* extra spaces padding\n";
  19. print "*\n";
  20. print "* colortest -w -r -s\n";
  21. print "* available combination\n";
  22. print "*\n";
  23. print "**************************\n";
  24. if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) {
  25. push(@arr, [( " 16: 00/00/00", " 17: 00/00/5f", " 18: 00/00/87", " 19: 00/00/af", " 20: 00/00/d7", " 21: 00/00/ff")] );
  26. push(@arr, [( " 22: 00/5f/00", " 23: 00/5f/5f", " 24: 00/5f/87", " 25: 00/5f/af", " 26: 00/5f/d7", " 27: 00/5f/ff")] );
  27. push(@arr, [( " 28: 00/87/00", " 29: 00/87/5f", " 30: 00/87/87", " 31: 00/87/af", " 32: 00/87/d7", " 33: 00/87/ff")] );
  28. push(@arr, [( " 34: 00/af/00", " 35: 00/af/5f", " 36: 00/af/87", " 37: 00/af/af", " 38: 00/af/d7", " 39: 00/af/ff")] );
  29. push(@arr, [( " 40: 00/d7/00", " 41: 00/d7/5f", " 42: 00/d7/87", " 43: 00/d7/af", " 44: 00/d7/d7", " 45: 00/d7/ff")] );
  30. push(@arr, [( " 46: 00/ff/00", " 47: 00/ff/5f", " 48: 00/ff/87", " 49: 00/ff/af", " 50: 00/ff/d7", " 51: 00/ff/ff")] );
  31. push(@arr, [( " 52: 5f/00/00", " 53: 5f/00/5f", " 54: 5f/00/87", " 55: 5f/00/af", " 56: 5f/00/d7", " 57: 5f/00/ff")] );
  32. push(@arr, [( " 58: 5f/5f/00", " 59: 5f/5f/5f", " 60: 5f/5f/87", " 61: 5f/5f/af", " 62: 5f/5f/d7", " 63: 5f/5f/ff")] );
  33. push(@arr, [( " 64: 5f/87/00", " 65: 5f/87/5f", " 66: 5f/87/87", " 67: 5f/87/af", " 68: 5f/87/d7", " 69: 5f/87/ff")] );
  34. push(@arr, [( " 70: 5f/af/00", " 71: 5f/af/5f", " 72: 5f/af/87", " 73: 5f/af/af", " 74: 5f/af/d7", " 75: 5f/af/ff")] );
  35. push(@arr, [( " 76: 5f/d7/00", " 77: 5f/d7/5f", " 78: 5f/d7/87", " 79: 5f/d7/af", " 80: 5f/d7/d7", " 81: 5f/d7/ff")] );
  36. push(@arr, [( " 82: 5f/ff/00", " 83: 5f/ff/5f", " 84: 5f/ff/87", " 85: 5f/ff/af", " 86: 5f/ff/d7", " 87: 5f/ff/ff")] );
  37. push(@arr, [( " 88: 87/00/00", " 89: 87/00/5f", " 90: 87/00/87", " 91: 87/00/af", " 92: 87/00/d7", " 93: 87/00/ff")] );
  38. push(@arr, [( " 94: 87/5f/00", " 95: 87/5f/5f", " 96: 87/5f/87", " 97: 87/5f/af", " 98: 87/5f/d7", " 99: 87/5f/ff")] );
  39. push(@arr, [( " 100: 87/87/00", " 101: 87/87/5f", " 102: 87/87/87", " 103: 87/87/af", " 104: 87/87/d7", " 105: 87/87/ff")] );
  40. push(@arr, [( " 106: 87/af/00", " 107: 87/af/5f", " 108: 87/af/87", " 109: 87/af/af", " 110: 87/af/d7", " 111: 87/af/ff")] );
  41. push(@arr, [( " 112: 87/d7/00", " 113: 87/d7/5f", " 114: 87/d7/87", " 115: 87/d7/af", " 116: 87/d7/d7", " 117: 87/d7/ff")] );
  42. push(@arr, [( " 118: 87/ff/00", " 119: 87/ff/5f", " 120: 87/ff/87", " 121: 87/ff/af", " 122: 87/ff/d7", " 123: 87/ff/ff")] );
  43. push(@arr, [( " 124: af/00/00", " 125: af/00/5f", " 126: af/00/87", " 127: af/00/af", " 128: af/00/d7", " 129: af/00/ff")] );
  44. push(@arr, [( " 130: af/5f/00", " 131: af/5f/5f", " 132: af/5f/87", " 133: af/5f/af", " 134: af/5f/d7", " 135: af/5f/ff")] );
  45. push(@arr, [( " 136: af/87/00", " 137: af/87/5f", " 138: af/87/87", " 139: af/87/af", " 140: af/87/d7", " 141: af/87/ff")] );
  46. push(@arr, [( " 142: af/af/00", " 143: af/af/5f", " 144: af/af/87", " 145: af/af/af", " 146: af/af/d7", " 147: af/af/ff")] );
  47. push(@arr, [( " 148: af/d7/00", " 149: af/d7/5f", " 150: af/d7/87", " 151: af/d7/af", " 152: af/d7/d7", " 153: af/d7/ff")] );
  48. push(@arr, [( " 154: af/ff/00", " 155: af/ff/5f", " 156: af/ff/87", " 157: af/ff/af", " 158: af/ff/d7", " 159: af/ff/ff")] );
  49. push(@arr, [( " 160: d7/00/00", " 161: d7/00/5f", " 162: d7/00/87", " 163: d7/00/af", " 164: d7/00/d7", " 165: d7/00/ff")] );
  50. push(@arr, [( " 166: d7/5f/00", " 167: d7/5f/5f", " 168: d7/5f/87", " 169: d7/5f/af", " 170: d7/5f/d7", " 171: d7/5f/ff")] );
  51. push(@arr, [( " 172: d7/87/00", " 173: d7/87/5f", " 174: d7/87/87", " 175: d7/87/af", " 176: d7/87/d7", " 177: d7/87/ff")] );
  52. push(@arr, [( " 178: d7/af/00", " 179: d7/af/5f", " 180: d7/af/87", " 181: d7/af/af", " 182: d7/af/d7", " 183: d7/af/ff")] );
  53. push(@arr, [( " 184: d7/d7/00", " 185: d7/d7/5f", " 186: d7/d7/87", " 187: d7/d7/af", " 188: d7/d7/d7", " 189: d7/d7/ff")] );
  54. push(@arr, [( " 190: d7/ff/00", " 191: d7/ff/5f", " 192: d7/ff/87", " 193: d7/ff/af", " 194: d7/ff/d7", " 195: d7/ff/ff")] );
  55. push(@arr, [( " 196: ff/00/00", " 197: ff/00/5f", " 198: ff/00/87", " 199: ff/00/af", " 200: ff/00/d7", " 201: ff/00/ff")] );
  56. push(@arr, [( " 202: ff/5f/00", " 203: ff/5f/5f", " 204: ff/5f/87", " 205: ff/5f/af", " 206: ff/5f/d7", " 207: ff/5f/ff")] );
  57. push(@arr, [( " 208: ff/87/00", " 209: ff/87/5f", " 210: ff/87/87", " 211: ff/87/af", " 212: ff/87/d7", " 213: ff/87/ff")] );
  58. push(@arr, [( " 214: ff/af/00", " 215: ff/af/5f", " 216: ff/af/87", " 217: ff/af/af", " 218: ff/af/d7", " 219: ff/af/ff")] );
  59. push(@arr, [( " 220: ff/d7/00", " 221: ff/d7/5f", " 222: ff/d7/87", " 223: ff/d7/af", " 224: ff/d7/d7", " 225: ff/d7/ff")] );
  60. push(@arr, [( " 226: ff/ff/00", " 227: ff/ff/5f", " 228: ff/ff/87", " 229: ff/ff/af", " 230: ff/ff/d7", " 231: ff/ff/ff")] );
  61. push(@arr, [( " 232: 08/08/08", " 233: 12/12/12", " 234: 1c/1c/1c", " 235: 26/26/26", " 236: 30/30/30", " 237: 3a/3a/3a")] );
  62. push(@arr, [( " 238: 44/44/44", " 239: 4e/4e/4e", " 240: 58/58/58", " 241: 62/62/62", " 242: 6c/6c/6c", " 243: 76/76/76")] );
  63. push(@arr, [( " 244: 80/80/80", " 245: 8a/8a/8a", " 246: 94/94/94", " 247: 9e/9e/9e", " 248: a8/a8/a8", " 249: b2/b2/b2")] );
  64. push(@arr, [( " 250: bc/bc/bc", " 251: c6/c6/c6", " 252: d0/d0/d0", " 253: da/da/da", " 254: e4/e4/e4", " 255: ee/ee/ee")] );
  65. if( $ARGV[0] eq "-s" || $ARGV[1] eq "-s" || $ARGV[2] eq "-s" ){
  66. $padding = " ";
  67. }
  68. else {
  69. }
  70. # display in reverse order
  71. if( $ARGV[0] eq "-r" || $ARGV[1] eq "-r" || $ARGV[2] eq "-r" ){
  72. for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) {
  73. $seed = ($dimone % 6) * -1;
  74. for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {
  75. $movone = $seed;
  76. $movtwo = $seed * -1;
  77. print $arr[$dimone][$dimtwo] . $padding;
  78. $seed = $seed+1;
  79. }
  80. print "\n";
  81. }
  82. }
  83. else {
  84. for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) {
  85. $seed = ($dimone % 6) * -1;
  86. for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {
  87. $movone = $seed;
  88. $movtwo = $seed * -1;
  89. $newone = $dimone+$movone;
  90. $newtwo = $dimtwo+$movtwo;
  91. if( $newone < scalar @arr ){
  92. print $arr[$newone][$newtwo] . $padding;
  93. }
  94. $seed = $seed+1;
  95. }
  96. print "\n";
  97. }
  98. }
  99. print "\n";
  100. print "\n";
  101. }
  102. else {
  103. print " 16: 00/00/00\n";
  104. print " 17: 00/00/5f\n";
  105. print " 18: 00/00/87\n";
  106. print " 19: 00/00/af\n";
  107. print " 20: 00/00/d7\n";
  108. print " 21: 00/00/ff\n";
  109. print " 22: 00/5f/00\n";
  110. print " 23: 00/5f/5f\n";
  111. print " 24: 00/5f/87\n";
  112. print " 25: 00/5f/af\n";
  113. print " 26: 00/5f/d7\n";
  114. print " 27: 00/5f/ff\n";
  115. print " 28: 00/87/00\n";
  116. print " 29: 00/87/5f\n";
  117. print " 30: 00/87/87\n";
  118. print " 31: 00/87/af\n";
  119. print " 32: 00/87/d7\n";
  120. print " 33: 00/87/ff\n";
  121. print " 34: 00/af/00\n";
  122. print " 35: 00/af/5f\n";
  123. print " 36: 00/af/87\n";
  124. print " 37: 00/af/af\n";
  125. print " 38: 00/af/d7\n";
  126. print " 39: 00/af/ff\n";
  127. print " 40: 00/d7/00\n";
  128. print " 41: 00/d7/5f\n";
  129. print " 42: 00/d7/87\n";
  130. print " 43: 00/d7/af\n";
  131. print " 44: 00/d7/d7\n";
  132. print " 45: 00/d7/ff\n";
  133. print " 46: 00/ff/00\n";
  134. print " 47: 00/ff/5f\n";
  135. print " 48: 00/ff/87\n";
  136. print " 49: 00/ff/af\n";
  137. print " 50: 00/ff/d7\n";
  138. print " 51: 00/ff/ff\n";
  139. print " 52: 5f/00/00\n";
  140. print " 53: 5f/00/5f\n";
  141. print " 54: 5f/00/87\n";
  142. print " 55: 5f/00/af\n";
  143. print " 56: 5f/00/d7\n";
  144. print " 57: 5f/00/ff\n";
  145. print " 58: 5f/5f/00\n";
  146. print " 59: 5f/5f/5f\n";
  147. print " 60: 5f/5f/87\n";
  148. print " 61: 5f/5f/af\n";
  149. print " 62: 5f/5f/d7\n";
  150. print " 63: 5f/5f/ff\n";
  151. print " 64: 5f/87/00\n";
  152. print " 65: 5f/87/5f\n";
  153. print " 66: 5f/87/87\n";
  154. print " 67: 5f/87/af\n";
  155. print " 68: 5f/87/d7\n";
  156. print " 69: 5f/87/ff\n";
  157. print " 70: 5f/af/00\n";
  158. print " 71: 5f/af/5f\n";
  159. print " 72: 5f/af/87\n";
  160. print " 73: 5f/af/af\n";
  161. print " 74: 5f/af/d7\n";
  162. print " 75: 5f/af/ff\n";
  163. print " 76: 5f/d7/00\n";
  164. print " 77: 5f/d7/5f\n";
  165. print " 78: 5f/d7/87\n";
  166. print " 79: 5f/d7/af\n";
  167. print " 80: 5f/d7/d7\n";
  168. print " 81: 5f/d7/ff\n";
  169. print " 82: 5f/ff/00\n";
  170. print " 83: 5f/ff/5f\n";
  171. print " 84: 5f/ff/87\n";
  172. print " 85: 5f/ff/af\n";
  173. print " 86: 5f/ff/d7\n";
  174. print " 87: 5f/ff/ff\n";
  175. print " 88: 87/00/00\n";
  176. print " 89: 87/00/5f\n";
  177. print " 90: 87/00/87\n";
  178. print " 91: 87/00/af\n";
  179. print " 92: 87/00/d7\n";
  180. print " 93: 87/00/ff\n";
  181. print " 94: 87/5f/00\n";
  182. print " 95: 87/5f/5f\n";
  183. print " 96: 87/5f/87\n";
  184. print " 97: 87/5f/af\n";
  185. print " 98: 87/5f/d7\n";
  186. print " 99: 87/5f/ff\n";
  187. print " 100 :87/87/00\n";
  188. print " 101 :87/87/5f\n";
  189. print " 102 :87/87/87\n";
  190. print " 103 :87/87/af\n";
  191. print " 104 :87/87/d7\n";
  192. print " 105 :87/87/ff\n";
  193. print " 106 :87/af/00\n";
  194. print " 107 :87/af/5f\n";
  195. print " 108 :87/af/87\n";
  196. print " 109 :87/af/af\n";
  197. print " 110 :87/af/d7\n";
  198. print " 111 :87/af/ff\n";
  199. print " 112 :87/d7/00\n";
  200. print " 113 :87/d7/5f\n";
  201. print " 114 :87/d7/87\n";
  202. print " 115 :87/d7/af\n";
  203. print " 116 :87/d7/d7\n";
  204. print " 117 :87/d7/ff\n";
  205. print " 118 :87/ff/00\n";
  206. print " 119 :87/ff/5f\n";
  207. print " 120 :87/ff/87\n";
  208. print " 121 :87/ff/af\n";
  209. print " 122 :87/ff/d7\n";
  210. print " 123 :87/ff/ff\n";
  211. print " 124 :af/00/00\n";
  212. print " 125 :af/00/5f\n";
  213. print " 126 :af/00/87\n";
  214. print " 127 :af/00/af\n";
  215. print " 128 :af/00/d7\n";
  216. print " 129 :af/00/ff\n";
  217. print " 130 :af/5f/00\n";
  218. print " 131 :af/5f/5f\n";
  219. print " 132 :af/5f/87\n";
  220. print " 133 :af/5f/af\n";
  221. print " 134 :af/5f/d7\n";
  222. print " 135 :af/5f/ff\n";
  223. print " 136 :af/87/00\n";
  224. print " 137 :af/87/5f\n";
  225. print " 138 :af/87/87\n";
  226. print " 139 :af/87/af\n";
  227. print " 140 :af/87/d7\n";
  228. print " 141 :af/87/ff\n";
  229. print " 142 :af/af/00\n";
  230. print " 143 :af/af/5f\n";
  231. print " 144 :af/af/87\n";
  232. print " 145 :af/af/af\n";
  233. print " 146 :af/af/d7\n";
  234. print " 147 :af/af/ff\n";
  235. print " 148 :af/d7/00\n";
  236. print " 149 :af/d7/5f\n";
  237. print " 150 :af/d7/87\n";
  238. print " 151 :af/d7/af\n";
  239. print " 152 :af/d7/d7\n";
  240. print " 153 :af/d7/ff\n";
  241. print " 154 :af/ff/00\n";
  242. print " 155 :af/ff/5f\n";
  243. print " 156 :af/ff/87\n";
  244. print " 157 :af/ff/af\n";
  245. print " 158 :af/ff/d7\n";
  246. print " 159 :af/ff/ff\n";
  247. print " 160 :d7/00/00\n";
  248. print " 161 :d7/00/5f\n";
  249. print " 162 :d7/00/87\n";
  250. print " 163 :d7/00/af\n";
  251. print " 164 :d7/00/d7\n";
  252. print " 165 :d7/00/ff\n";
  253. print " 166 :d7/5f/00\n";
  254. print " 167 :d7/5f/5f\n";
  255. print " 168 :d7/5f/87\n";
  256. print " 169 :d7/5f/af\n";
  257. print " 170 :d7/5f/d7\n";
  258. print " 171 :d7/5f/ff\n";
  259. print " 172 :d7/87/00\n";
  260. print " 173 :d7/87/5f\n";
  261. print " 174 :d7/87/87\n";
  262. print " 175 :d7/87/af\n";
  263. print " 176 :d7/87/d7\n";
  264. print " 177 :d7/87/ff\n";
  265. print " 178 :d7/af/00\n";
  266. print " 179 :d7/af/5f\n";
  267. print " 180 :d7/af/87\n";
  268. print " 181 :d7/af/af\n";
  269. print " 182 :d7/af/d7\n";
  270. print " 183 :d7/af/ff\n";
  271. print " 184 :d7/d7/00\n";
  272. print " 185 :d7/d7/5f\n";
  273. print " 186 :d7/d7/87\n";
  274. print " 187 :d7/d7/af\n";
  275. print " 188 :d7/d7/d7\n";
  276. print " 189 :d7/d7/ff\n";
  277. print " 190 :d7/ff/00\n";
  278. print " 191 :d7/ff/5f\n";
  279. print " 192 :d7/ff/87\n";
  280. print " 193 :d7/ff/af\n";
  281. print " 194 :d7/ff/d7\n";
  282. print " 195 :d7/ff/ff\n";
  283. print " 196 :ff/00/00\n";
  284. print " 197 :ff/00/5f\n";
  285. print " 198 :ff/00/87\n";
  286. print " 199 :ff/00/af\n";
  287. print " 200 :ff/00/d7\n";
  288. print " 201 :ff/00/ff\n";
  289. print " 202 :ff/5f/00\n";
  290. print " 203 :ff/5f/5f\n";
  291. print " 204 :ff/5f/87\n";
  292. print " 205 :ff/5f/af\n";
  293. print " 206 :ff/5f/d7\n";
  294. print " 207 :ff/5f/ff\n";
  295. print " 208 :ff/87/00\n";
  296. print " 209 :ff/87/5f\n";
  297. print " 210 :ff/87/87\n";
  298. print " 211 :ff/87/af\n";
  299. print " 212 :ff/87/d7\n";
  300. print " 213 :ff/87/ff\n";
  301. print " 214 :ff/af/00\n";
  302. print " 215 :ff/af/5f\n";
  303. print " 216 :ff/af/87\n";
  304. print " 217 :ff/af/af\n";
  305. print " 218 :ff/af/d7\n";
  306. print " 219 :ff/af/ff\n";
  307. print " 220 :ff/d7/00\n";
  308. print " 221 :ff/d7/5f\n";
  309. print " 222 :ff/d7/87\n";
  310. print " 223 :ff/d7/af\n";
  311. print " 224 :ff/d7/d7\n";
  312. print " 225 :ff/d7/ff\n";
  313. print " 226 :ff/ff/00\n";
  314. print " 227 :ff/ff/5f\n";
  315. print " 228 :ff/ff/87\n";
  316. print " 229 :ff/ff/af\n";
  317. print " 230 :ff/ff/d7\n";
  318. print " 231 :ff/ff/ff\n";
  319. print " 232 :08/08/08\n";
  320. print " 233 :12/12/12\n";
  321. print " 234 :1c/1c/1c\n";
  322. print " 235 :26/26/26\n";
  323. print " 236 :30/30/30\n";
  324. print " 237 :3a/3a/3a\n";
  325. print " 238 :44/44/44\n";
  326. print " 239 :4e/4e/4e\n";
  327. print " 240 :58/58/58\n";
  328. print " 241 :62/62/62\n";
  329. print " 242 :6c/6c/6c\n";
  330. print " 243 :76/76/76\n";
  331. print " 244 :80/80/80\n";
  332. print " 245 :8a/8a/8a\n";
  333. print " 246 :94/94/94\n";
  334. print " 247 :9e/9e/9e\n";
  335. print " 248 :a8/a8/a8\n";
  336. print " 249 :b2/b2/b2\n";
  337. print " 250 :bc/bc/bc\n";
  338. print " 251 :c6/c6/c6\n";
  339. print " 252 :d0/d0/d0\n";
  340. print " 253 :da/da/da\n";
  341. print " 254 :e4/e4/e4\n";
  342. print " 255 :ee/ee/ee\n";
  343. print "\n";
  344. print "\n";
  345. }
  346. print "0m";
  347. exit;