Yes coughing up phlegm is usually the end of a cold.
Whenever my cold virus is about over and I'm recovering from the cold I start coughing up some yellow thick phlegm and then as the cold virus is more on it's way out of my body the phlegm then starts to turn to clear.
I may cough up phlegm for as long as a few weeks after the cold but the phlegm is usually clear in color.
The phlegm contains bacteria that your body is trying to get rid of so always cough up the phlegm and spit it out to get rid of that bacteria.
If you try to just swallow the phlegm then the bacteria stays in your body and then it takes longer to recover from the cold virus.
Coughing up the phlegm is a good thing and it means your cold virus is about over with.