function sq(x) { return x * x; } window.red = function (x, y, width, height) { var DIM = Math.max(width, height); var s = 3 / (y + 99), scalar = 1, h = (y + Math.sin((x*x + sq(y - 700)*5) / 100 / DIM)*35)*s; return (Math.floor(scalar * ((x+DIM)*s+h))%2+Math.floor(scalar * ((DIM*2-x)*s+h))%2)*127; } window.green = function (x, y, width, height) { var DIM = Math.max(width, height); var s = 3 / (y + 99), scalar = 5, h = (y + Math.sin((x*x + sq(y - 700)*5) / 100 / DIM)*35)*s; return (Math.floor(scalar * ((x+DIM)*s+h))%2+Math.floor(scalar * ((DIM*2-x)*s+h))%2)*127; } window.blue = function (x, y, width, height) { var DIM = Math.max(width, height); var s = 3 / (y + 99), scalar = 29, h = (y + Math.sin((x*x + sq(y - 700)*5) / 100 / DIM)*35)*s; return (Math.floor(scalar * ((x+DIM)*s+h))%2+Math.floor(scalar * ((DIM*2-x)*s+h))%2)*127; }