% Script Eg4_2
% Displays interpolants of the colors cyan and magenta

% Prepare the figure window...
  close all
  figure
  axis equal off
  hold on
  
% Initializations...             % 
  cyan    = [0 1 1];  % rgb of the "bottom" color
  magenta = [1 0 1];  % rgb of the "top" color
  n = 10;             % the number of "in between" colors is n-1
  
  for j=0:n
%    Display the jth tile and its rgb value... 
     f = j/n;
     c = (1-f)*cyan + f*magenta;
     fill([0 3 3 0],[0 0 1 1]+j,c)
     text(3.5,j+.5,sprintf('[ %4.2f , %4.2f , %4.2f ]',c(1),c(2),c(3)))
  end
  hold off
  shg
  
