refactor DominantColors into smaller methods