'===========================================================================
' Subject: DISPLAY 136 COLORS                 Date: 08-27-98 (22:51)       
'  Author: Darryl R. Waltz                    Code: QB, QBasic, PDS        
'  Origin: drw@telusplanet.net              Packet: EGAVGA.ABC
'===========================================================================
'Program: NEWCOLOR.BAS (QBasic)
'Display 136 colors on screen in SCREEN Mode 12
'Will be creating a new QBasic paint program to implement this feature soon.
'author: Darryl R. Waltz
'email: drw@telusplanet.net
'Date: August 27 1998

SCREEN 12: DIM p%(30000), pp%(30000)

'create new colors
FOR x1 = 0 TO 14
  FOR x2 = x1 + 1 TO 15
    FOR r = 0 TO 15
      xx = xx + 1: IF xx = 3 THEN xx = 1
      IF xx = 1 THEN c1 = x1: c2 = x2
      IF xx = 2 THEN c1 = x2: c2 = x1
      FOR c = 0 TO 14 STEP 2
        PSET (c, r), c1: PSET (c + 1, r), c2
      NEXT c
    NEXT r
    s = s + 100: GET (0, 0)-(15, 15), p%(s): y = y + 1
  NEXT x2
NEXT x1

'display 120 Pseudo Colors
aa = 0: bb = 30: ss = 0
FOR g = 1 TO y
  ss = ss + 100: PUT (aa, bb), p%(ss), PSET
  aa = aa + 20: IF aa > 620 THEN aa = 0: bb = bb + 20
NEXT g

'show 16 regular colors
a = 0: b = 15
FOR c1 = 0 TO 15
  FOR r = a TO b
    FOR c = 0 TO 15
      PSET (r, c), c1
    NEXT c
  NEXT r
  a = a + 20: b = b + 20
NEXT c1
  
LOCATE 1, 41
PRINT "16 regular colors"

LOCATE 7, 61
PRINT "120 psuedo colors"
