Cable knitting with two colors involves a technique known as intarsia. The cable is knit in one color, while the background is knit in another color, making the cables pop even more and stand out from the background. Usually cables are knit in a solid color of yarn. With this technique, you can knit the cable in a solid color and knit the background in a multicolored yarn without affecting the visual of the cable.
Work in the background color until you get to the cable cross stitches.
Join in the second color of yarn by twisting the main color and the end of the cable color together at the back of the work. Knit the cable stitches normally in the new color.
Join in another ball of yarn in the background color. Twist the cable color and the tail end of the background color together at the back of the work, and work the background stitches in the new color.
Cross the cables as normally done, keeping only the stitches that are part of the cross in the cable color, and all background stitches in the main color. For more elaborate crosses, the yarn can be carried along the back of the work, as in the fair isle technique, for no more than four stitches without needing to join in a new ball of yarn. For stitches more than four apart, join in a new ball of yarn and use the same technique as in Steps 2 and 3.
Start with a simple cable with a single cross, until you get the hang of it, before attempting more difficult cables with a background between cable crosses.