Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tp6 Flood
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EL GAOUAL Zaid
Tp6 Flood
Commits
51c56a9d
Commit
51c56a9d
authored
2 years ago
by
EL GAOUAL Zaid
Browse files
Options
Downloads
Patches
Plain Diff
Cyclic
parent
aa69c8eb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/model/CyclicColorGenerator.java
+11
-3
11 additions, 3 deletions
app/src/main/java/model/CyclicColorGenerator.java
with
11 additions
and
3 deletions
app/src/main/java/model/CyclicColorGenerator.java
+
11
−
3
View file @
51c56a9d
...
...
@@ -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
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment