BBS: Inland Empire Archive Date: 04-01-93 (23:44) Number: 302 From: EARL MONTGOMERY Refer#: NONE To: MIKHAIL FERDMAN Recvd: NO Subj: 256 Colors Conf: (2) Quik_Bas
'part 2 of 4 parts.
END IF
GOTO loop2
Text2:
t = TIMER
WHILE TIMER < t + 3
WEND
SCREEN 9
CLS
COLOR 14
PRINT "Well that should be enough to prove the point. So how";
PRINT "do we access all those beautiful shades of color";
PRINT "available in VGA? Well we can accomplish this by going";
PRINT "directly to the VGA palette Registers. Remember that";
PRINT "each color consist of Red Green & Blue components. We";
PRINT "can set any color to any shade by adjusting the amount":
PRINT "of R G B within the color. How do we accomplish this?"
PRINT
PRINT "Example:"
PRINT "SCREEN 13:CLS"
PRINT "OUT &H3C8,22"
PRINT "OUT&H3C9,55:OUT&H3C9,45:OUT&H3C9,25"
PRINT "End of example"
PRINT "Send the color you wish to work with to register &H3C8.";
PRINT : PRINT "In this case color 22."
PRINT "Send the RGB values (0-63) to &H3C9. In this case Red";
PRINT "is 55, Green is 45 and Blue is 25. This particular"'
PRINT "combination gives a predominant yellow shade."
PRINT "Let's see it in action. First we will draw and color";
PRINT "the circle with color 22 then we will change the RGB";
PRINT "to change it to a shade of yellow."
PRINT
PRINT " Press any key to continue."
wait2:
i$ = INKEY$
IF i$ = "" THEN
GOTO wait2
END IF
SCREEN 13
CLS
COLOR 22
CIRCLE (160, 100), 90
PAINT (160, 100), 22, 22
t = TIMER
WHILE TIMER < t + 3
WEND
OUT &H3C8, 22
OUT &H3C9, 55
OUT &H3C9, 45
OUT &H3C9, 25
t = TIMER
WHILE TIMER < t + 3
WEND
SCREEN 9
CLS
COLOR 14
PRINT "Now let's draw a line and move it down the screen but";
PRINT "each time we move it down we will increase the GREEN";
PRINT "value by .1 to show various shades that are possible."
t = TIMER
WHILE TIMER < t + 9
WEND
'End of part 2 of 4 parts.
--- Maximus 2.01wb
* Origin: Verbose Ink * Dallas * 214-437-0914 * V32b/HST (1:124/5125)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET