Toribash
It should work, something like this should randomise once, then draw a square based on this.
function randomise()
r = math.random(0,1000)/1000
g = math.random(0,1000)/1000
b = math.random(0,1000)/1000
a = math.random(0,1000)/1000
end

randomise()

local function draw2d()
set_color(r,g,b,a)
draw_quad(100,100,300,300)
end

add_hook("draw2d","randomquad",draw2d)
:D