WOW THAT TURNED OUT AWESOME!!!!
EXACTLY LIKE PRO'S GRADIENT BOX EFFECT
heres all the functions, sorry there has to be 4 but it worked out amazing, try putting rgb(255,0,0), rgb(0,255,0), rgb(0,0,255), and rgb(255,255,255) (red, green, blue, white) into the function, its wicked!!
function gradient_box(gbx1,gby1,gbx2,gby2,tlcorner,trcorner,blcorner,brcorner)
height#=gby2-gby1
for y=gby1 to gby2
color1=color_change_percent(tlcorner,blcorner,((y-gby1)/height#)*100.0)
color2=color_change_percent(trcorner,brcorner,((y-gby1)/height#)*100.0)
gradient_line(gbx1,y,gbx2,y,color1,color2)
next y
endfunction
function gradient_line(glx1,gly1,glx2,gly2,color1,color2)
while t#<100
inc t#,100/dist#(glx1,gly1,glx2,gly2)
k#=t#
k#=k#/100
x#=glx1+k#*(glx2-glx1)
y#=gly1+k#*(gly2-gly1)
ink color_change_percent(color1,color2,t#),0
dot x#,y#
endwhile
endfunction
function dist#(dx1,dy1,dx2,dy2)
xlen=abs(dx2-dx1)
ylen=abs(dy2-dy1)
distance#=sqrt((xlen*xlen)+(ylen*ylen))
endfunction distance#
function color_change_percent(startcolor,endcolor,percent#)
red1 = rgbr(startcolor) : red2 = rgbr(endcolor)
green1 = rgbg(startcolor) : green2 = rgbg(endcolor)
blue1 = rgbb(startcolor) : blue2 = rgbb(endcolor)
newred=(red2-red1)*(percent#/100.0)+red1
newgreen=(green2-green1)*(percent#/100.0)+green1
newblue=(blue2-blue1)*(percent#/100.0)+blue1
newcolor=rgb(newred,newgreen,newblue)
endfunction newcolor
[edit]
nvm, false alarm, it worked awesome in pro, but not at all in DBC
also this is a great time to mention something I learned through this project, local variables (variables specific to functions) arent specific to EACH function, so if you have the same variable used in two functions and you call one in the other, then once the call is done and you return to the 1st function that variable will be equal to its value in the second, a big problem
There are only 10 kinds of people in the world, those who understand binary and those who dont