You need to carry the yarn over the work on the wrong side ..very difficult to explain without actually sitting with you and showing you !
In other words if you knit twenty stitches in red then ten in blue then twenty in red ..on the purl side you would purl twenty in red purl ten in red and so on but carry the blue along the back of the work .
Are you doing this from a graph ?
If so you knit from right to left on your knit row and read from left to right when returning on the purl row.
Another way you can do it is the intarsia method whereby if you are using lots of different colours you can wind the wool onto small bobbins and pick up each colour as you go along floating it over the wrong side .
Have a look here ..I know it's for socks ..but scroll down and it will show you the technique .
http://www.socknitters.com/kickback/KBlesson2. htm