Colour does not need to equal a new material. If it’s about changing just the colour, try the Per Instance Custom Data approach - definitely the most fun to learn out of the abovementioned bunch:
In short: imagine you did not need to store colour information in a material, but you could do it in each sphere instance instead. Here’s an example: