% colors_rgb.m
% Let user type [r,g,b] and display a square of that color.
% You have to Control-C out of this program!
%
xlist = [ 0, 1, 1, 0 ];
ylist = [ 0, 0, 1, 1 ];

while ( true )

  color = input ( 'Enter RGB values in brackets [r,g,b]:' );

  clf

  fill ( xlist, ylist, color );

  title_string = sprintf ( ' [ %.3f, %.3f, %.3f ]', color );
  title ( title_string );
  axis off

end

