Skip to content
Snippets Groups Projects
Commit e5997ace authored by NGUYEN Thi hang's avatar NGUYEN Thi hang
Browse files

THN

parent a3e29c44
No related branches found
No related tags found
No related merge requests found
package model;
import java.awt.*;
import java.util.List;
public class DistinctColorGenerator {
List<Color> colors;
Color defaultColor;
public DistinctColorGenerator(List<Color> colors, Color defaultColor){
this.colors=colors;
this.defaultColor=defaultColor;
}
public Color nextColor(Cell cell ){
for(int i=0; i < colors.size(); i++){
if (colors.get(i)==cell){
return colors.get(i);
}
}
return defaultColor;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment