% let the image size to be 1200x1800
% cd c:\mydocu~1\psych221\project\morepic2

vert = 1200;
hori = 1800;
temp = zeros(vert,hori,3);
sinline = 0.9+0.1*sin(2*pi*[0:hori-1]/120);
sinmat = repmat(sinline',1,1200)';

midgrey = [0.5 0.5 0.5];
midtone = midgrey/norm(midgrey);

% using the rgb definition for the encoding.
red = [1 0 0];
green = [0 1 0];
blue = [ 0 0 1];

% some other surrounding color
yellow = [0.985 0.864 0.371];
purple = [0.528 0.432 0.562];
orange = [0.932 0.600 0.403];

color = [red;green;blue;yellow;purple;orange];
colorstring = {'red','grern','blue','yellow','purple','orange'};

for i=1:1:6
   temp(:,:,1) = color(i,1)*sinmat;
   temp(1:200,1:200,1) = midtone(1);
   temp(1001:1200,1:200,1) = midtone(1);
   temp(1:200,1601:1800,1) = midgrey(1);
   temp(1001:1200,1601:1800,1) = midgrey(1);
   
   temp(:,:,2) = color(i,2)*sinmat;
   temp(1:200,1:200,2) = midtone(2);
   temp(1001:1200,1:200,2) = midtone(2);
   temp(1:200,1601:1800,2) = midgrey(2);
   temp(1001:1200,1601:1800,2) = midgrey(2);

   temp(:,:,3) = color(i,3)*sinmat;
   temp(1:200,1:200,3) = midtone(3);
   temp(1001:1200,1:200,3) = midtone(3);
   temp(1:200,1601:1800,3) = midgrey(3);
   temp(1001:1200,1601:1800,3) = midgrey(3);
   
   image(temp);
   pause(1);
   imwrite(temp,['bal' upper(colorstring{i}) '.jpg'],'jpg');
end

