'=========================================================================== ' Subject: SPREAD PALETTES Date: 02-05-98 (20:08) ' Author: Kyle Petersen Code: QB, QBasic, PDS ' Origin: Kyle_Petersen@cocc.edu Packet: GRAPHICS.ABC '=========================================================================== 'Simple program that illustrates using a spread for the palette. This 'function is highly recommended for anyone dealing with the palette, whether 'it be in games, drawing programs, or anything else. '----------Have Fun!-------------------------------- 'Kyle Petersen DECLARE SUB spread (col1%, col2%) DEFINT A-Z SCREEN 13 CLS FOR t = 0 TO 255 LINE (t + 10, 10)-(t + 10, 190), t NEXT LOCATE 1, 1: PRINT "Before spread..." w$ = INPUT$(1) FOR cnt = 0 TO 3 READ number$ LOCATE 1, 1: PRINT "After " + number$ + " spread. " READ first, last spread first, last w$ = INPUT$(1) NEXT DATA "first", 0, 31 DATA "second", 31, 63 DATA "third", 63, 127 DATA "fourth", 127,255 SUB spread (col1%, col2%) IF col2% > col1% THEN OUT 967, col1% r1 = INP(969) g1 = INP(969) b1 = INP(969) OUT 967, col2% r2 = INP(969) g2 = INP(969) b2 = INP(969) ml = col2% - col1% pl! = r2 - r1 pl1! = g2 - g1 pl2! = b2 - b1 pl! = pl! / ml pl1! = pl1! / ml pl2! = pl2! / ml r! = 0: g! = 0: b! = 0 FOR t = col1% TO col2% OUT 968, t OUT 969, INT(r1 + r!) OUT 969, INT(g1 + g!) OUT 969, INT(b1 + b!) r! = r! + pl! g! = g! + pl1! b! = b! + pl2! NEXT END IF END SUB