I think there are only three ways to interpolate between two angles. None of them is perfect:
1) Always interpolate the acute (or obtuse) angle
2) Choose clockwise or counter-clockwise for your interpolation
3) Don't wrap around your angle values
Method 1 will work fine, as long as you always want to interpolate the smaller (or larger) angle difference. You run into a problem if the difference between the angles is exactly 180 degrees--in which case you have to flip a coin.
Method 2 is fool-proof, as long as you have a way of deciding whether an interpolation needs to go clockwise or counter-clockwise... which may end up taking you back to option 1.
Method 3 is an idea where you store angles in your own variables, allowing them to stretch as far as need be, positive or negative. So, interpolations will always go in the right direction, and could even include whole rotations before reaching the final destination... but then you might not want that. --and actually, I don't think this applies to your color-wheel problem.
I think the best solution for you is to use Method 1. In the rare case of an angular difference of exactly 180 degrees, take a survey of the surrounding pixels to see which way they're turning. If you still end up with a 50-50 split, then flip a coin.
1) Always interpolate the acute (or obtuse) angle
2) Choose clockwise or counter-clockwise for your interpolation
3) Don't wrap around your angle values
Method 1 will work fine, as long as you always want to interpolate the smaller (or larger) angle difference. You run into a problem if the difference between the angles is exactly 180 degrees--in which case you have to flip a coin.
Method 2 is fool-proof, as long as you have a way of deciding whether an interpolation needs to go clockwise or counter-clockwise... which may end up taking you back to option 1.
Method 3 is an idea where you store angles in your own variables, allowing them to stretch as far as need be, positive or negative. So, interpolations will always go in the right direction, and could even include whole rotations before reaching the final destination... but then you might not want that. --and actually, I don't think this applies to your color-wheel problem.
I think the best solution for you is to use Method 1. In the rare case of an angular difference of exactly 180 degrees, take a survey of the surrounding pixels to see which way they're turning. If you still end up with a 50-50 split, then flip a coin.