Skip to content
Snippets Groups Projects
Commit b771349f authored by dragapsy's avatar dragapsy
Browse files

Tache 4 (La methode nextColor de la classe CyclicColorGenerator).

parent f6320be3
No related branches found
No related tags found
No related merge requests found
......@@ -7,12 +7,19 @@ import java.util.List;
public class CyclicColorGenerator implements ColorGenerator{
private List<Color> colors;
private int counter=1;
public CyclicColorGenerator(List<Color> colors){
this.colors = colors;
}
@Override
public Color nextColor(Cell cell) {
return null;
if(counter >= this.colors.size()){
counter=0;
}
Color newColor = this.colors.get(counter);
counter++;
return newColor;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment