home *** CD-ROM | disk | FTP | other *** search
-
- NOTICE: This article originally appeared in the February issue of Atari
- Interface Magazine and may be freely distributed or reprinted in non-profit
- User Group publications as long as the article's author and Atari Interface
- Magazine are credited AND this notice is reprinted with the article. All
- other publications must obtain written permission from Unicorn Publications,
- 3487 Braeburn Circle, Ann Arbor, MI 48108, Phone: (313) 973-8825 before using
- this article.
-
- The Basics of BASIC
- by Rick Burton (RACE)
-
- To further explore "graphic illustrations" of the characteristics of color,
- this month we will start to tie the SETCOLOR and COLOR commands together. Be
- patient enough to read carefully AND type example demos as you go. Soon you
- will appreciate 8bit capability and become a real painter of pixels.
-
- Last month we saw that SETCOLOR is followed by three numbers separated by
- commas. The first number was used to select text, border, and background. From
- now on, we will call this the register number or SETCOLOR register. Each
- SETCOLOR register contains "default" colors and brightness. Registers are
- numbered 0 to 4. Using GRAPHICS 3 as an example, the following is a run-down
- on these registers:
-
- SETCOLOR 0: contains orange- access with COLOR 1
-
- SETCOLOR 1: contains light green- access with COLOR 2
-
- SETCOLOR 2: contains dark blue- access with COLOR 3
-
- SETCOLOR 3: not used in GRAPHICS 3
-
- SETCOLOR 4: contains black- access with COLOR 0 (also
- controls background)
-
- Notice that the COLOR command can access SETCOLOR registers! The great
- COLOR/SETCOLOR connection! Different COLOR commands can be used at the same
- time to draw different colored lines on your monitor. The desired color
- command precedes the line or lines to be drawn that color. Confused? Fire up
- that 8bit and type this:
-
- 10 GRAPHICS 3+16 20 COLOR 1 30 PLOT 8,2 40 DRAWTO 8,22
- 50 COLOR 2 60 PLOT 20,12 70 DRAWTO 20,22 80 COLOR 3 90
- PLOT 32,8 100 DRAWTO 32,22 110 GOTO 110 120 END
-
- There you have it -- a simple bar graph. Compare the SETCOLOR register chart
- with the commands found in the demo program. COLOR 1 accesses SETCOLOR 0
- (default orange), COLOR 2 accesses SETCOLOR 1 (default light green), and COLOR
- 3 accesses SETCOLOR 2 (default dark blue). Now lets stir up a new color on our
- artist's palette. Change SETCOLOR register 1 by typing:
-
- 55 SETCOLOR 1,5,6
-
- Run this demo with the new program line. When the paint brush is dipped in
- COLOR 2, out comes violet! (See last month's Basics for details on SETCOLOR
- and a color table.)
-
- A last note -- line 15 from last month should have read: 15 FOR X=1 TO 14 STEP
- 2. Apologies for the typo. We'll see all you 8bit artists next month for
- more "graphic illustrations" of the characteristics of color...
-