I have a really hazy memory of a fantasy book series for children/teenagers that I read in the early/mid 2000s (in German, but I don't know if it was translated from English). It might have been born out of the Harry Potter craze.
It involved a sort of tiered magical tower or city (?) where each "level" corresponded to a color from the rainbow. "Red" inhabitants were basically living in slums and had barely any magic available to them, while the "Indigo" people at the top were the powerful elite (both political and magical). There were 7 castes/colors in total (as there are 7 colors in the rainbow).
The story involved a boy and a girl that somehow ended up in a higher level than they were allowed to. They found out, I think, that the ability to cast higher colored magic was not something you inherently were gifted with, but it was something you could learn. This was kept a secret by the powerful upper castes, to prevent an uprising (?) from the more numerous lower castes.
I borrowed these books from a library back then, so I think they would have been reasonably famous at the time, but it's been almost 20 years.