palette statememnt...

 BBS: SPOKANE CENTRAL
Date: 01-25-93 (04:11)             Number: 36
From: TIM PETERSON #145 @5930      Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: palette statememnt...          Conf: (17) QuickBASIC

What a can of worms! That statement works differently in different modes. In cga modes(screen1), it has no effect with a cga adaptor, but you can change any of the standard 4 colors to any color you want, but only from the 16 background colors. In screen 9, there are 64 colors to choose from. In either case, you simply say "PALETTE coloryouwanttochange, newcolor". If you just say "PALETTE", you re-set the color values to the stock values. In the vga and mcga modes,(such as screen 11) it works the same only different. In these modes, you can selact from over 260,000 colors. Instead of simply choosing a number from those 260,00 colors, you specify the exact amounts of red, blue, and gree you want. You can have any of 63 values(64 including zero) for each color. You specify how much of each by a screwy kludge. You multiply the red value you want by 65,536, then the blue(or is it green?) by 256, and the green value you leave alone. Add all three together like this: PALETTE coloryouwanttochange, red*65536+blue*256+green. If you are still confused, you can call me up. I did figure out the palette command pretty well 'cuz I LOVE color. I got a nifty way to bypass dos and send colors to the ports directly, if you want. It is about ten times faster than using the palette statement, which is important if you are trying to update all 256 colors of screen13. Btw, Microsoft insists on calling the number you use to specify color an ATTRIBUTE {LINE(x,y),attribute}, and the numbers you feed the palette statement are called COLORS. You change the attribute with the COLOR statement, no less. I think it is easier to think of them as colornumbers and actual colors. You assign a color to a colornumber, or use the stock color. I have tons of cool color routines. If you tell me what you want to do, I'll whip something up for you. If all you have is cga, the palette statement does nothing, but won't cause an error if it is otherwise allowed. [0m [31m Tim Peterson [0m
Outer Court
Echo Basic Postings

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