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 (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.7 $  $Date: 1997/11/21 23:34:24 $

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
