Skip to content
Snippets Groups Projects
Commit 51c56a9d authored by EL GAOUAL Zaid's avatar EL GAOUAL Zaid
Browse files

Cyclic

parent aa69c8eb
Branches
No related tags found
No related merge requests found
......@@ -3,8 +3,9 @@ import javafx.scene.paint.Color;
import java.util.List;
public class CyclicColorGenerator implements ColorGenerator {
public ArrayGrid grid;
public List<Color> colors;
private ArrayGrid grid;
private List<Color> colors;
private int i=0;
public CyclicColorGenerator(List<Color> colors) {
this.colors=colors;
......@@ -12,6 +13,13 @@ public class CyclicColorGenerator implements ColorGenerator {
@Override
public Color nextColor(Cell cell) {
return null;
Color color = colors.get(i);
if (i<colors.size()-1) {
i += 1;
}
else {
i=0;
}
return color;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment