Sperm can vary in colour from man to man by a small degree, the yellow discolouration normally means that,that particular patch of sperm has died, what I mean by that is, especially in teenagers or young adult males, who produce fresh sperm at least daily, it builds up when not released in any way, and can even turn lumpy in your ball sack, so when you do release it, it can often come out in thick globs,Yellow, and sometimes even hurt a bit.
If you don't masturbate regularly at least once a week,this might happen often
If you increase the times you masturbate you should notice a difference
In many nocturnal emissions ( wet dreams)deal with it
Source: