rebased+binary search+average colors