colors = $colors; } public function scheme() { $iter = new InfiniteIterator(new ArrayIterator($this->colors)); $iter->rewind(); return function () use ($iter) { $color = $iter->current(); $iter->next(); return $color; }; } }