Eyedropper with tolerance

Hi,

I’ve been working on an eyedropper tool which allows extracting HSV values from any area selected by the user through mouse interaction. This bit works but I would like to add in some adjustable tolerance around the color which has been selected so the user could for instance select part of a subject’s clothing and even shaded areas would be included in the color selection. I’ve tried a few things using the chroma key TOP’s H,S,V min and max parameters but I’m not getting the expected results.

I’m curious as to what approach you may have used in the past to match color selection across similar tones. Perhaps my approach isn’t the best either. Maybe I should look into a “magic wand” selection scheme instead?

Any comments and ideas are welcome and much appreciated.

Thanks,