Since this is an infinite runner, I assume your background colors are procedurally generated. I'm not sure on your algorithm, but take that color output and limit its range.
You could simply exclude your platform color(s) as a possible background color option (but the background could be a tiny bit different and hard to differentiate). For example:
IF backColor = platformColor THEN GetNextBackgroundColor().
You could create a 'IsColorSimilar(color1, color2)' function for this also, but more difficult.
Use a list of known valid background colors, and cycle through them.
Have different color 'styles' for both. Your platform could be bright and cheerful, and limit your background colors to desaturated colors. You need to move away from the traditional RBG way of representing colors, and move to a model such as HSL.
A great Unity add-on for working with colors is ColorTools. It costs $10, but is worth it. https://www.assetstore.unity3d.com/en/#!/content/21966
It has methods for generating colors for what you are looking for, such as Desaturate() for desaturating your generated background color, and IsSimilar() to check if the two colors are too close of a match to each other.
You can find other similar functionality for free in other libraries on the net with a bit of searching.