When you change a color in a purl stitch, it shows. When I've changed colors on ribbing at the bottom of a sweater I knit the whole row to avoid this, but I don't know if that will work for your scarf. There's no way to not have it happen. In fact, Elizabeth Zimmerman refers to it as the 'dreaded purl bump.' Some patterns use it as a design feature, though, you you have to decide if you can live with it.
You can try knitting across the whole row and see if/how it affects the look of your scarf.