DECLARE SUB DQBfadeTo (BYVAL Red, BYVAL Green, BYVAL Blue)
Red - Red hue to fade colors into
Green - Green hue to fade colors into
Blue - Blue hue to fade colors into
none
Fades all the colors in current palette to the specified red, green and blue hues. To fade a palette to black, just call this function with 0,0,0 as parameters; it's quite powerful, as it can fades any palette to any specified color.
*****************************************************************************
' All integers for speed
DEFINT A-Z
'$INCLUDE:'DIRECTQB.BI'
DIM Pal AS STRING * 768
' Let's initialize the library with no extra layers nor sounds nor EMS
IF DQBinit(0, 0, 0) THEN DQBclose: PRINT DQBerror$: END
DQBinitVGA
' Stores the default palette into Pal
DQBgetPal Pal
' Turns all the colors to black
DQBpalOff
' Draws randomly 500 pixels on the screen
FOR i = 1 TO 500
RANDOMIZE TIMER
DQBpset VIDEO, (RND*320), (RND*200), (RND*256)
NEXT i
' Fades the palette into the original one
DQBfadeIn Pal
' Fades the palette to white
DQBfadeTo 63, 63, 63
' and then to black
DQBfadeTo 0,0,0
' Restores the original palette
DQBsetPal Pal
' Waits for the user to press a key
WHILE INKEY$ = "": WEND
' Ends program
DQBclose
*****************************************************************************