Considering that colors are a three-dimensional quantity with ambiguous ordering (#FF0000 and #00FF00 being equal distance from #000000 for example) I’m not sure how you’re thinking a binary search would trivialize this?
Hex is always specific ordering, R > G > B. They're all 0 through F (16 digits). It gives you a "higher, lower, equals" on every digit. That means it's 6 cases of binary searches, 2^4 = 16, so that's all you're going to need.
This is what I get for not actually clicking the link..each of the dimensions are given independent indications of being too high or too low