Color of Trainer Card means your "rank". It is determined by Trainer Stars.
In D/P/Pt colors are:
Red, Blue, Bronze, Silver, Gold, Black
In HG/SS colors are:
Red, Blue, Green, Violet, Grey, Black
How to get stars:
Defeat Elite 4 for first time
Complete National PokéDex (except Mew, Celebi, Jirachi, Deoxys, Phione, Manaphy, Shymin, Darkrai, Arceus)
Defeat 100 trainers in Battle Tower
Win any Master Rank in Contests (D/P/Pt)
Obtain Platinum Flag in the Underground (D/P/Pt)
Show 5 Shiny Leaves on 1 Pokémon to Ethan/Lyra (HS)
Beat all 10 records on PokéAthlon (HS)