def get_next_color(ax=None, nonintrusive=True):
if ax is None:<EOL><INDENT>ax = mpl.pyplot.gca()<EOL><DEDENT>i = <NUM_LIT:1>  <EOL>cycle = ax._get_lines.prop_cycler  <EOL>color = None<EOL>a = next(cycle)     <EOL>while(a != next(cycle)):<EOL><INDENT>i += <NUM_LIT:1><EOL>color = a['<STR_LIT>']<EOL><DEDENT>if nonintrusive:<EOL><INDENT>for j in range(i - <NUM_LIT:1>):<EOL><INDENT>next(cycle)<EOL><DEDENT><DEDENT>return color<EOL>
Return the next color to be used in the given color cycle. 

    Warning: due to the structure of Python iterators I couldn't help but
    iterate over all the color cycle once. 

    If nonintrusive is True, then leave the color cycle in the same state as 
    before