TGC Codebase Backup



colors by Mark Garrett

12th Jul 2005 1:13
Summary

Does a print-out of all the colors of the rainbow, and shows their corresponding rgb value



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem Understanding colors

set display mode 1024,768,16

ink rgb(255,0,0),0:print "ink rgb(255,0,0),0"
ink rgb(255,255,0),0:print "ink rgb(255,255,0),0"
ink rgb(0,255,0),0:print "ink rgb(0,255,0),0"
ink rgb(0,255,255),0:print "ink rgb(0,255,255),0"
ink rgb(0,0,255),0:print "ink rgb(0,0,255),0"
ink rgb(255,0,255),0:print "ink rgb(255,0,255),0"
print " "
sync on
sync rate 0
rem beggining rgb values
r = 255:g = 0:b = 0


do

g = g + 5: if g = 255 then goto two
gosub printit

loop
do
two:
r = r - 5: if r = 0 then goto three
gosub printit
loop

do
three:
b = b + 5: if b = 255 then goto four
gosub printit
loop

do
four:
g = g - 5: if g = 0 then goto five
gosub printit
loop

do
five:
r = r + 5: if r = 255 then goto six
gosub printit
loop

do
six:
b = b - 5: if b = 0 then goto seven
gosub printit
loop

seven:
suspend for key

end

printit:
inc w: if w = 7 then print " ": w = 0
ink rgb(r,g,b),0:print "rgb[",r,",",g,",",b,"]    ";
sync
return