Whenever a colour functions as a noun, like they do in this sentence, the word should match the neuter form that it would have as an adjective, hence the added -t in 'rødt'. 'Rosa' has the same ending for all genders as an adjective, and so it stays the same as a noun.
'Farge' is actually a masculine word, so if you were to use 'rødt' as an adjective to match it, then it would turn into 'rød' again:
"En rød farge"
"A red colour"
You can read about this in the 'tips and notes' section of the Color skill. :)
I have a question about another exercise in this unit (but that exercise does not allow a discussion). The other exercise says "Write the Norwegian word for 'green'". I responded "grønt", which was marked incorrect. The correct answer was shown as "grønn". But... it didn't ask for "green" as an adjective. I happened to reply with "green" as a noun. Shouldn't that also be correct? I put my comment here because this exercise also uses colors as nouns.