draw.GradientRect = function(posx, posy, length, size, r, g, b, a, y_rect, other_side)
length=a/length
if other_side == 0 and y_rect == 0 then
for i=a, 0, -length do
draw.Color(r,g,b,i)
draw.FilledRect(posx, posy, posx+length, posy-size)
posx = posx+1
end
elseif other_side == 1 and y_rect == 0 then
for i=a, 0, -length do
draw.Color(r,g,b,i)
draw.FilledRect(posx, posy, posx-length, posy-size)
posx = posx-1
end
end
if other_side == 0 and y_rect == 1 then
for i=a, 0, -length do
draw.Color(r,g,b,i)
draw.FilledRect(posx, posy, posx-size, posy-length)
posy = posy-1
end
elseif other_side == 1 and y_rect == 1 then
for i=a, 0, -length do
draw.Color(r,g,b,i)
draw.FilledRect(posx, posy, posx-size, posy+length)
posy = posy+1
end
end
end