-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework cyclops palette package, add Gradient class for managing map c…
…olour schemes
- Loading branch information
1 parent
266cd5d
commit 4ee53a4
Showing
27 changed files
with
379 additions
and
978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
...n/palette/palettes/ColourListPalette.java → ...ualization/palette/ColourListPalette.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...src/main/java/org/peakaboo/framework/cyclops/visualization/palette/ColourStopPalette.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.peakaboo.framework.cyclops.visualization.palette; | ||
|
||
import java.util.List; | ||
|
||
public class ColourStopPalette extends ColourListPalette { | ||
|
||
|
||
public ColourStopPalette(PaletteColour colour) { | ||
this(Gradient.DEFAULT_STEPS, colour); | ||
} | ||
|
||
public ColourStopPalette(int steps, PaletteColour colour) { | ||
super(Gradient.extrapolateStops(steps, getMonochromeStops(colour)), false); | ||
} | ||
|
||
public ColourStopPalette(Gradient gradient) { | ||
this(Gradient.DEFAULT_STEPS, gradient, false); | ||
} | ||
|
||
public ColourStopPalette(Gradient gradient, boolean hasNegatives) { | ||
this(Gradient.DEFAULT_STEPS, gradient, hasNegatives); | ||
} | ||
|
||
public ColourStopPalette(int steps, Gradient gradient, boolean hasNegatives) { | ||
super(Gradient.extrapolateStops(steps, gradient), hasNegatives); | ||
} | ||
|
||
private static List<Gradient.Stop> getMonochromeStops(PaletteColour c) { | ||
return List.of( | ||
new Gradient.Stop(new PaletteColour(0xff000000), 0), | ||
new Gradient.Stop(c, 1) | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.