How to knit vertical stripes with color change at borders

Hello guys,I’ve been struggling to start my knitting of a racetrack as I can’t find any tutorial that teaches me how to change vertical strip color at border every few stitches,anyone has any idea how can I start?

I want to knit a scarf that has red and white interchangable border colors with grey in the middle,thank you for your suggestions❤️
image

Welcome to the forum!
Very intriguing idea. You would use the intarsia technique for changing colors between the borders and the main body.

As for changing color on the borders, the technique is similar to a striped scarf. If the colors are each used for a few rows, you could carry the unused color up the edge (for the right side border) or you could cut the strand of one color leaving about a 4-6" tail to weave in later.
You may find that you want to line the scarf to cover the color changes on the back. Also, if you use stockinette (knit one row, purl one row) throughout, the scarf is going to curl.

Thank you so much,I’ve been struggling to get it right for so long, loads of thanks!