Here the major triads that are checked are correct and preferred.
Those that are blue are slightly less common but are still used often.
Those that are red and marked with an “X” are not incorrect, but they are rare and appear in complicated music with difficult modulations. We avoid using them unless we have no other choice.
Note to advanced musicians: Gb Major and F# Major are both checked as preferred because they represent two keys that are equal in number of sharps or flats in the key signatures in which they are tonic triads.
The key of Gb has six flats. The key of F# has six sharps.
Cb Major/C# Major are tonic triads in keys that have seven sharps/seven flats. Music is written in these keys, but generally musicians choose the keys of Db Major/B Major, which have five flats/five sharps and are thus easier to read and simpler to notate.