Christian left this link on another question I find it quite useful perhaps you will too http://canoo.net/services/Controller?dispatch=inflection&input=rot&features=%28Cat+A%29&country=D&lookup=caseInSensitive
There are a set of rules or steps that you need to take in order to determine what adjective ending should be used. For the most part, the ending is determined by the article preceding it. In this case, Ein calls for a different ending (rotes) than Das would (rote).
It's confusing but this link should help break it down for you: