side-effect in this case is the easiest way and simplifies the implementation a lot.. if it wasn't by the side-effect we would need to every single call to `_getNextColor` return a new array of used colors and update the reference.