Refactor filterColors() with reduce()