SetGradientPalette(id, startcolor, endcolor)
id. The first pen
will be initialized to the color specified in startcolor and the last pen will be
initialized to the color specified in endcolor. All pens between the first and the
last pen will be filled with intermediary colors so that the result will be a smooth
gradient between startcolor and firstcolor. Obviously, the more colors the palette
has, the smoother the resulting gradient will be so it's recommended to set the
palette depth to 8 (= 256 colors) for the best result.
@DISPLAY {Palette = #PALETTE_DEFAULT, Height = 512}
CreatePalette(1)
SetGradientPalette(1, #BLACK, #BLUE)
SetPaletteMode(#PALETTEMODE_PEN)
SetPalette(1)
SetFillStyle(#FILLCOLOR)
For Local y = 0 To 255
SetDrawPen(y)
Box(0, y * 2, 640, 2)
Next
The code above creates gradient between black and blue in palette 1 and draws it.