You can set your own colours for lines you plot and you can also specify the colours used on an axes by setting the
property of an axes. By default this is a 7x3 array. You can extend it or replace it with any number of rows you want so long as it is nx3.
The legend doesn't run out of colours either, it just reflects the colours assigned to the plots so if they repeat then obviously so does it otherwise it would not be reflecting the curves correctly.