By using the correct formulas, it is possible to build any of the four types of triads on any note of the chromatic scale. For example, if you start with the note D and add a note a major third above it (F#) and a minor third above that (A), you end up with a D major chord. If you start with the note A and add a note a minor third above it (C) and a major third above that (E), you end up with an A minor chord.
If you go through and analyse all of the scale tone chords in the key of C major, you end up with the following pattern:
This pattern remains the same regardless of the key. This means that if you look at the scale tone triads in any major key, chord 1 is always major, chord 2 is always minor, chord 8 is always minor, etc. The only thing that changes from one key to the next is the letter names of the chords. This can be demonstrated by looking at the scale tone triads for the key of G major which are shown in this exercise.