Cook spaghetti according to package directions in salted water.
Melt butter in a large skillet. Add onion and cook until onion is soft, about 5 minutes.
Add soup, milk, and both peppers to the skillet and mix well.
Add ham, peas, cheddar cheese, and Parmesan cheese and stir and cook over medium heat until cheese is melted, about 1-2 minutes.
Add drained pasta to the pan and mix well.