How to i add color to a double knited scarf

i’l be using 3 colors, 2 on each side, and if i just knit the new color i’ll end up with a loose end… and when i knit each side, i need to carry to original color cause i’m making a pattern, how do i do that?

Could you be more specific as to what you’re doing with the colors?