I have overhauled the code. I used fade object and set ambient light commands in the old code. I have replaced those commands with set object ambient command. I understand now that fade object and set ambient light does not work correctly with enhancements. So if you have enhancements use this code if not use the original code.
set display mode 640,480,32:cls 0:hide mouse
cls 0
rem Draws the color spectrum onto screen
rem by changing the rgb's up and down, drawing
rem a single line in colors from red to violet
rem and changing the x/y coordinates.
red=255
redin=0
greenin=1
bluein=0
y=1:x=1
ink rgb(128,128,128),0
text 0,415,"Sloooowly draaaawing theeee coooolor sssspectrummmm......"
repeat
ink rgb(red,green,blue),0
box x,y,x,y+49
inc x
inc red,redin
inc green,greenin
inc blue,bluein
if t=256 then dec x:ink rgb(128,128,128),0:text 0,430,"Hum the Jeopardy theme song ......if it helps......"
if t=767 then dec x
if t=1277 then dec x:ink rgb(128,128,128),0:text 0,460,"Anyone for a 3rd verse?"
if t=509 then inc y,50:x=1
if t=1020 then inc y,50:x=1:ink rgb(128,128,128),0:text 0,445,"Maybe hum it twice......"
if t>255 and t<511 then redin=-1:green=255:blue=0
if t=>510 and t<766 then red=0:green=255:bluein=1
if t>765 and t<1022 then red=0:greenin=-1:blue=255
if t>1020 and t<1276 then redin=1:green=0:blue=255
if t>1275 and t<1531 then red=255:green=0:bluein=-1
t=t+1
until t>1530
sleep 2000
rem Get the image of the whole color spectrum.
rem Sprite the image and then scale it down.
rem Get a new image from the downsized sprite (smaller color spectrum).
get image 1,1,1,510,150
cls 0
paste image 1,1,1
ink rgb(128,128,128),0
text 0,460,"The color spectrum image is complete."
sleep 7000
sprite 1,700,500,1
set sprite 1,0,0
scale sprite 1,25
cls 0
paste sprite 1,1,1
get image 2,1,1,128,139
cls 0
paste image 2,1,1
ink rgb(128,128,128),0
text 0,460,"The color spectrum image has been "sprited" and downsized......"
sleep 10000
rem Get an image of each of the three sections of the spectrum image
rem and paste them end to end.
get image 3,1,2,128,14
get image 4,1,14,128,26
get image 5,1,26,128,38
cls 0
paste image 3,1,1
paste image 4,128,1
paste image 5,251,1
ink rgb(128,128,128),0
text 0,445,"Three images have been took from the color spectrum image."
text 0,460,"The three images are then pasted end to end and a new spectrum image is taken."
sleep 15000
rem Get the image of the color spectrum in one horizonal row.
rem Sprite this image and then scale it down.
rem Get a new image from the scaled sprite.
get image 6,1,1,378,13
cls 0
paste image 6,1,1
sprite 1,700,500,6
stretch sprite 1,50,400
cls 0
paste sprite 1,1,1
get image 7,1,1,189,50
ink rgb(128,128,128),0
text 0,460,"The color spectrum image has been "sprited" and resized again......"
sleep 7000
cls 0
rem The previous image (10) is used to texture a plain.
rem By using fade object, ambient light and backdrop colors
rem the luminance of the textured object is changed.
rem At each change a single line image is taken
rem from the object plain.
rem The one line images are pasted line by line to build the final
rem color palette image.
ink rgb(255,255,255),0
box 0,20,189,300
get image 10,0,0,189,300
ink rgb(128,128,128),0
text 0,430,"This is the area where the color palette will be drawn. It will be drawn with single lines"
text 0,445,"of images taken from a plain textured with the color spectrum image. As the images are"
text 0,460,"taken, the set object ambient and backdrop colors are changed."
sleep 25000
cls 0:sync on:backdrop on:color backdrop 0
make object plain 1,190,150
set object 1,1,0,0,1,1,0,1
texture object 1,7
rotate object 1,14,0,0
position object 1,0,-99,389
ghost object on 1
fade object 1,0
position camera 0,0,0
set ambient light 100
pic=200:picy=20
cls 0:sync on:backdrop on:color backdrop 0
paste image 10,0,0
for fo=0 to 128 step 2
paste image 10,0,0
ink rgb(128,128,128),0
text 0,460,"Getting line by line image as the object is faded......"
set object ambient 1,rgb(fo,fo,fo)
get image pic,226,170,415,171
paste image pic,0,picy
sync
inc pic:inc picy
get image 10,0,0,189,300
next fo
for al=128 to 255
paste image 10,0,0
ink rgb(128,128,128),0
text 0,460,"Getting line by line image as the ambient light is brightened......"
set object ambient 1,rgb(al,al,al)
get image pic,226,170,415,171
paste image pic,0,picy
sync
inc pic:inc picy
get image 10,0,0,189,300
next al
for c=0 to 255 step 4
paste image 10,0,0
ink rgb(128,128,128),0
text 0,460,"Getting line by line image as the backdrop is brightened......"
color backdrop rgb(c,c,c)
get image pic,226,170,415,171
paste image pic,0,picy
sync
inc pic:inc picy
get image 10,0,0,189,300
next c
fo=255:set ambient light 100:color backdrop 0
repeat
paste image 10,0,0
ink rgb(128,128,128),0
text 0,430,"As the plain slowly fades into the darkness, we have completed part of the color palette."
if delay > 100
dec fo,3
if fo<0 then fo=0
set object ambient 1,rgb(fo,fo,fo)
endif
inc delay
sync
until delay=300
hide object 1
sync off:backdrop off
cls 0
paste image 10,0,0
ink rgb(128,128,128),0
text 0,430,"It needs a gray gradient from white to black."
sleep 5000
rem Draw a white box at the bottom left corner of the new color palette image.
rem Draw a gray gradient from white box to a black box
rem at the bottom right corner of the new color palette image.
ink rgb(128,128,128),0
text 0,445,"Drawing a white box, the gray gradient and a black box......"
ink rgb(255,255,255),0
box 0,300,31,360
x=32
for t=255 to 0 step-2
ink rgb(t,t,t),0
box x,300,x,360
inc x
next t
ink 0,0
box 158,300,189,360
get image 10,0,0,189,360
sleep 3000
ink rgb(128,128,128),0
text 0,460,"Check it out. The final large image of the color palette......cool huh?"
sleep 12000
cls 0
rem Make a sprite of this image (10) and downsize it.
rem Get a new image of downsized sprite.
paste image 10,0,0
sprite 1,700,500,10
stretch sprite 1,67,30
cls 0
paste sprite 1,0,0
ink rgb(128,128,128),0
text 0,460,"The final downsized sprite of the color palette......"
rem Because there is no sync rate the following
rem pause (sleep command) is necessary
rem or the final image is shortened to only
rem half of what the "get image" coordinates call it to get.
sleep 7000
rem This image is the final downsized color palette image and it is
rem saved to your computer.
get image 10,0,0,126,127
rem If you run this program more than once be sure and REM line 201, delete the file or
rem change the name of the following file:
save image "color palette 01.bmp",10
cls 0
repeat
text 0,430,"This is the final color palette image and it has been saved to your computer under"
text 0,445,"the name 'color palette 01.bmp'. You need to delete that file, REM line 201 or"
text 0,460,"change the file name before running this program again. (Press spacekey to end)"
paste image 10,0,0
until spacekey()=1
end