Qbasicnews.com
November 13, 2019, 04:21:47 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: COLOR fg, bg  (Read 2156 times)
Ralph
Ancient Guru
****
Posts: 544


« on: February 12, 2007, 02:42:18 AM »

The QuickBASIC Help, Index, COLOR statement, double click, shows that, for SCREEN 11-13, COLOR only allows the foreground color, thus:
COLOR  foreground.

But, if we use this first
WIDTH 80,25 'or 30, or 43, or 60
we can then use
COLOR foreground, background
Furthermore, the foreground (or background) colors aren't limited to 0-7, but can be 0-31.  How about that?  This enables a blinking foreground.

I don't remember using or seeing this used before.  Is this something new for most QBers here, or is this just old stuff?
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Radical Raccoon
I hold this place together
*****
Posts: 914



WWW
« Reply #1 on: February 12, 2007, 02:55:25 AM »

old stuff
Logged

Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #2 on: February 12, 2007, 05:00:42 PM »

Up to 31 colors?  I can't see how!
PC text Screen attributes save the foreground color in one byte per character: 4 bits for foreground and 4 bits for background. This gives 15 colors for foreground and 15 for background. The 7 upper colors for the foreground are bright colors, while for background you can set a bit somewhere to decide if the 7 upper colors are bright or blinking.
This is how the BIOS text screen works, and how Windows should emulate it
Logged

Antoni
Ralph
Ancient Guru
****
Posts: 544


« Reply #3 on: February 12, 2007, 10:37:48 PM »

Antoni:

Sorry that I said "31 colors".  What I meant was that we could use 0-31 for the foreground numbers following the COLOR statement, giving the 0-7 colors, 8-15 "bright", or "light" colors, and, by using any of those 0-15 colors with the addition of 16 (which gives the 16-31), those first 0-15 colors are blinked on and off.

I found that, for the background, only 0-15 could be used.
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!