function newcolor = bwcontr(cc)
%BWCONTR Contrasting black or white color.
%   NEW = BWCONTR(COLOR) produces a black or white depending on which
%   one would contrast the most.  Used by NODITHER.
 
%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.9 $  $Date: 2000/06/01 02:54:18 $

if (isstr(cc))
    warning([mfilename ' was passed a string -- using black'])
    newcolor = [0 0 0];
else
    if ((cc * [.3; .59; .11]) > .75)
        newcolor = [0 0 0];
    else
        newcolor = [1 1 1];
    end
end
