You may want to use Lab, HLS or distance measures to compute the average color. https://stackoverflow.com/questions/649454/what-is-the-best-way-to-average-two-colors-that-define-a-linear-gradient