Skip to content

Commit

Permalink
Fix TestBuilder rainbox palette to not wrap totally
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Davis <[email protected]>
  • Loading branch information
dr-jts committed Aug 15, 2019
1 parent 5237cf7 commit a535d02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static HSBPalette customPalette(Color clrBase, int numHues) {
);
}
else if (DisplayParameters.FILL_RAINBOW == DisplayParameters.fillType()) {
return HSBPalette.createRainbowSequential(numHues, 0.4f, 1);
return HSBPalette.createRainbow(numHues, 0.4f, 1);
}
else if (DisplayParameters.FILL_RAINBOW_RANDOM == DisplayParameters.fillType()) {
return PAL_RAINBOW_INCREMENTAL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@

public class HSBPalette {

public static HSBPalette createRainbowSequential(int numHue, float s, float b) {
public static HSBPalette createRainbow(int numHue, float s, float b) {
return new HSBPalette(numHue, 0, 1 - 0.08333f,
1, s, s,
1, b, b
);
}

public static HSBPalette createRainbowWrap(int numHue, float s, float b) {
return new HSBPalette(numHue, 0, 1,
1, s, s,
1, b, b
Expand Down

0 comments on commit a535d02

Please sign in to comment.