Implement nearestColor method