home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / TNH_PC.ZIP / METZGER.NL < prev    next >
Encoding:
Text File  |  1987-01-14  |  5.9 KB  |  230 lines

  1. Super Color For the IBM Personal Computer
  2.  
  3.              Alan Metzger
  4.        North Jersey IBM PC Club
  5.  
  6. Everyone knows that only two color
  7. palettes are available in medium
  8. resolution graphics on the P.C.
  9. Right?  Wrong!!  If you use a
  10. television set or a composite monitor
  11. hooked up to a standard IBM
  12. Color/Graphics adapter, 20 different
  13. palettes can be yours.  If you have
  14. an RGB monitor, you can have 22
  15. different palettes. The best news is
  16. that you don't have to be a
  17. professional programmer to use the
  18. palettes.  If you can use the two
  19. standard palettes, the following
  20. instructions should get you the bonus
  21. palettes with no trouble.
  22.  
  23. First, let me review the standard
  24. medium resolution palettes:
  25.  
  26. SCREEN 1,0  'sets medium res graphics
  27. COLOR b,p   'chooses background color
  28.              "b" amd palette "p"
  29.  
  30. The COLOR statement in the IBM BASIC
  31. Manual states that the background
  32. color "b" is in the range of 0 to 15,
  33. and the colors available are:
  34.  
  35. Color      Palette 0        Palette 1
  36.   1         Green            Cyan
  37.   2         Red              Magenta
  38.   3         Brown            White
  39.  
  40. But there's more to it than that.
  41. Standard Palettes and "LIGHT"
  42. Standard Palettes
  43.  
  44. If you look carefully, you will
  45. notice that when you switch from a
  46. background color between 0 and 7 to
  47. one between 8 and 15, not only the
  48. background changes to one of the
  49. "light" colors, but the palette
  50. colors also become "light", too. Try
  51. the following BASIC program to see
  52. the effect.
  53.  
  54. 10  CLS   'clear the screen
  55. 20  SCREEN 1,0   'set medium res
  56.     graphics mode
  57. 30  COLOR 1,1   'set blue background
  58.     and palette CYAN/MAGENTA/WHITE
  59. 40  CIRCLE(80,100),30,1:PAINT
  60.     (80,100),1: LOCATE 7,10:
  61.     PRINT "1"    'Color #1
  62. 50  CIRCLE(160,100),30,2:PAINT
  63.     (160,100),2: LOCATE 7,20:
  64.     PRINT "2"    'Color #2
  65. 60  CIRCLE(240,100),30,3:PAINT
  66.     (240,100),3: LOCATE 7,30:
  67.     PRINT "3"    'Color #3
  68. 70  LOCATE 1,1
  69. 80  INPUT "ENTER BACKGROUND COLOR - "
  70.     ,B
  71. 90  COLOR B  'use selected background
  72. 100 GOTO 40
  73. 110 END
  74.  
  75. Run the program and enter 1 (blue).
  76. Then enter 9 (light blue). Look
  77. carefully at the circles as you
  78. toggle the colors. Try other colors.
  79.  
  80. At this point some of you are
  81. probably saying "OK, but the whole
  82. screen gets 'light'". Try your
  83. program again, this time entering 1
  84. followed by 17. Same background but
  85. with a "light" palette.
  86.  
  87. Here's the rule:
  88.  
  89. BACKGROUND
  90. COLOR
  91.  
  92. 0-7 dark
  93. Palette 0
  94. GREEN/RED/BROWN
  95. Palette 1
  96. CYAN/MAGENTA/WHITE
  97.  
  98. 8-15 light
  99. Palette 0
  100. Lt.GREEN/Lt.RED/Lt.YELLOW
  101. Palette 1
  102. Lt.CYAN/Lt.MAGENTA/H.I.WHITE
  103.  
  104. 16-23 dark
  105. Palette 0
  106. Lt.GREEN/Lt.RED/YELLOW
  107. Palette 1
  108. Lt.CYAN/Lt.MAGENTA/H.I.WHITE
  109.  
  110. CYAN/RED/WHITE
  111.  
  112. A third palette pair, CYAN/RED/WHITE,
  113. is available if you have an RGB
  114. monitor.  This trick doesn't work on
  115. a television or composite monitor but
  116. results in a WHITE/WHITE/WHITE on
  117. WHITE palette.
  118.  
  119. Insert the following line in your
  120. program:
  121.  
  122. 35 OUT 984,14 'select CYAN/RED/WHITE
  123.  
  124. NOTE:  You can also get
  125. CYAN/RED/WHITE by using a SCREEN 1,2
  126. command in BASIC, but it also blanks
  127. the screen rather then merely
  128. changing palettes.
  129.  
  130. To be certain that everything gets
  131. RESET back to normal, you can enter:
  132. SCREEN 0,0: SCREEN 1,0
  133.  
  134. Six palettes down and sixteen to go.
  135.  
  136. SIXTEEN "UNICHROME" PALETTES
  137.  
  138. Sixteen additional "UNICHROME" or
  139. "several shades of one color hue"
  140. palettes also are available. These
  141. come with any background you want AS
  142. LONG AS YOU WANT BLACK.  For some
  143. reason the TV/composite people really
  144. benefit here as can be seen in the
  145. color table below. Take an original
  146. program you wrote above and add the
  147. following line:
  148.  
  149. 35 OUT 984,26 'set "UNICHROME"
  150.    palette mode
  151. (Remember!!! OUT 984,10 sets it back
  152.  to NORMAL)
  153.  
  154. When you RUN the program you should
  155. see the palettes shown below.  These
  156. palettes are on a black background
  157. only. Be careful! If you enter 0
  158. (BLACK) the palette is BLACK on
  159. BLACK. (#8 GRAY may also be very
  160. difficult to see if your RGB monitor
  161. is not adjusted correctly.)
  162.  
  163. The palette is selected by:
  164.  
  165. COLOR p  'select "UNICHROME" palette
  166.  
  167. On an RGB monitor, the selected
  168. palette color(0-15) is palette color
  169. #3. Colors #1 and #2 appear to be
  170. one-half intensity versions of #3.
  171. Color #0 is BLACK, the background
  172. color.
  173.  
  174. The colors seen on a TV or composite
  175. monitor will vary depending on the
  176. adjustment of the hue/tint and color
  177. controls. The colors given are those
  178. I see on my modular/television.
  179.  
  180. UNICHROME PALETTES
  181. COLOR       RGB Monitor
  182. 0       BLACK/BLACK/BLACK
  183. 1       DK.BLUE/DK.BLUE/BLUE
  184. 2       DK.GREEN/DK.GREEN/GREEN
  185. 3       DK.CYAN/DK.CYAN/CYAN
  186. 4       DK.RED/DK.RED/RED
  187. 5       DK.MAGENTA/DK.MAGENTA/MAGENTA
  188. 6       DK.BROWN/DK.BROWN/BROWN
  189. 7       GRAY/GRAY/WHITE
  190. 8       DK.GRAY/DK.GRAY/GRAY
  191. 9       BLUE/BLUE/LT.BLUE
  192. 10      GREEN/GREEN/LT.GREEN
  193. 11      CYAN/CYAN/LT.CYAN
  194. 12      RED/RED/LT.RED
  195. 13      MAGENTA/MAGENTA/LT.MAGENTA
  196. 14      DK.YELLOW/DK.YELLOW/YELLOW
  197. 15      WHITE/WHITE/BRT.WHITE
  198.  
  199.  
  200. COLOR    TV/Composite Color Monitor
  201. 0       BLACK/BLACK/BLACK
  202. 1       DK.MAGENTA/DK.BLUE/BLUE
  203. 2       MED.GREEN/DK.GREEN/BRT.GREEN
  204. 3       MED.GREEN/DK.BLUE/CYAN
  205. 4       DK.MAGENTA/DK.RED/RED
  206. 5       DK.MAGENTA/DK.BLUE/MAGENTA
  207. 6       DK.GREEN.DK.RED/BROWN
  208. 7       DK.GREEN/DK.BROWN/WHITE
  209. 8       DK.GRAY/DK.GRAY/GRAY
  210. 9       LIGHTER VERSION OF 1 ABOVE
  211. 10      LIGHTER VERSION OF 2 ABOVE
  212. 11      LIGHTER VERSION OF 3 ABOVE
  213. 12      LIGHTER VERSION OF 4 ABOVE
  214. 13      LIGHTER VERSION OF 5 ABOVE
  215. 14      PALE GREEN/PALE RED/YELLOW
  216. 15      WHITE/WHITE/BRT.WHITE
  217.  
  218. It should be noted that the RGB
  219. colors 1 and 2 in palettes 9 thru 13
  220. above are not the same as color 3 in
  221. palettes 1 thru 5 respectively. They
  222. actually appear as half intensity
  223. paler out versions of palettes 1 thru
  224. 5 color 3.
  225.  
  226. That's it folks. Twenty two all
  227. different palettes. If you find any
  228. more, share the news and mention it
  229. to the editor.
  230.