The lines received their color names in 1965 as part of systemwide rebranding which also renamed stations (1964-1967), gave the Green Line branches letters (1967), etc. The rolling stock was not recolored until rather later for the most part. (I welcome corrections here.)
When the MBTA took over from the MTA in August 1964, all buses, trackless trolleys, and streetcars were painted in some version of the orange scheme (the newest busess from the early 60s were painted in an orange and white scheme, with unpainted silver aluminum in sections while the paint scheme on older buses, trackless trolleys, and PCC streetcars was the full orange and creme with a silver roof and maroon belt rail scheme). The equipment on the Cambridge-Dorchester (Red) Line was a new fleet of cars built in 1963, funded with money from the state, and painted in the "state colors" of blue and white with gold trim. The East Boston tunnel (Blue Line) had cars from 1924 that were repainted in a two-tone grey with orange belt scheme in 1951 when they were overhauled and another group of cars built in 1951 and delivered in that scheme. The MTA started repainting some of the 1951 East Boston cars blue and white, to match the paint of the 1963 Cambridge-Dorchester cars. The Main Line elevated (Orange Line) fleet consisted of 100 cars built in 1957-1958 that came painted in a grey and orange scheme. Some older equipment on the Main Line El and the Cambridge-Dorchester lines were also repainted from olive green or dark brown into this orange/grey scheme in the 1950s, but all of these cars were retired before 1964.
Cambridge Seven proposed that all new and refurbished equipment be painted in a grey and white scheme with bright yellow doors. As mentioned in another thread, several hundred new buses came delivered in this scheme, some older buses and 1 trackless trolley were repainted in this scheme, numerous PCC sreetcars were repainted, and six Orange Line cars.
This "grey ghost" scheme did go over well, it showed dirt easily and made equipment hard to see in snow and fog. In 1969, the new "South Shore" Red Line cars were delivered in unpainted silver aluminum with a thin red stripe.
In 1971, the grey ghost scheme was abandoned and the decision was made to paint equipment in the color of the assigned line. Buses would be painted yellow.
PCCs began appearing repainted green in 1972 and the Boeing LRVs were delivered green starting in 1976. It took a long time to repaint PCCs green, some were running on the Green Line with orange paint as late as 1984, just a year before the Arborway line closed and PCCs were retired from the Green Line.
The 1951 Blue Line cars were already painted in a blue and white scheme to match the 1963 red line cars, but the 1924 Blue Line cars were repainted from1950s two-tone grey to blue and white in the early 1970s. The 1957 Orange Line cars were repainted into a brighter orange and white scheme from the original 1957 orange and grey scheme. The present fleet from 1979-81 were delivered in a scheme that matched the repainted 1957 cars they replaced.
Aside from the thin red stripe on the 1969 cars, the Red Line was the last to see any cars painted into the color of the line, as the 1963 cars got red and white paint as they were rebuilt in the 1979-84 time period, and the 1969 cars were repainted in their present red and white scheme when they were rebuilt in 1985-88. In 1977, the PCCs assigned to the Mattapan-Ashmont line were repainted red. This was a short lived scheme, as the group of cars repainted in 1977 were retired in 1981 and replaced by another group of PCC cars which had recently been rebuilt and were painted green. Green PCCs remained at Mattapan until the cars were rebuilt again in 1999-2005 and came back repainted in the original orange and cream scheme that the cars were delivered in.