sixty-nine/php-cloud-lib

View on GitHub
src/SixtyNine/Cloud/Color/RotateColorGenerator.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace SixtyNine\Cloud\Color;

class RotateColorGenerator extends ColorGenerator
{
    protected $current = 0;

    /**
     * @return string
     */
    public function getNextColor()
    {
        $colors = $this->palette->getColors();
        $color = $colors[$this->current % count($colors)];
        $this->current++;
        return $color;
    }
}