Skip to content

Commit

Permalink
Fixed bug in decimal separator format due to locale issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AxisAlexNT committed Apr 14, 2024
1 parent 7f591e5 commit 3f8c50a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ru.itmo.ctlab.hict.hict_library.visualization.colormap.gradient.SimpleLinearGradient;

import java.awt.*;
import java.util.Locale;
import java.util.regex.Pattern;

@Getter(AccessLevel.PUBLIC)
Expand All @@ -33,8 +34,8 @@ public SimpleLinearGradientDTO(String startColorHEX, String endColorHEX, double
// final String endHEX = String.format("#%02x%02x%02x%02x", cmap.getEndColor().getRed(), cmap.getEndColor().getGreen(), cmap.getEndColor().getBlue(), cmap.getEndColor().getAlpha());

return new SimpleLinearGradientDTO(
String.format("rgba(%d,%d,%d,%f)", cmap.getStartColor().getRed(), cmap.getStartColor().getGreen(), cmap.getStartColor().getBlue(), ((double) cmap.getStartColor().getAlpha() / 255.0d)),
String.format("rgba(%d,%d,%d,%f)", cmap.getEndColor().getRed(), cmap.getEndColor().getGreen(), cmap.getEndColor().getBlue(), ((double) cmap.getEndColor().getAlpha() / 255.0d)),
String.format(Locale.US, "rgba(%d,%d,%d,%f)", cmap.getStartColor().getRed(), cmap.getStartColor().getGreen(), cmap.getStartColor().getBlue(), ((double) cmap.getStartColor().getAlpha() / 255.0d)),
String.format(Locale.US, "rgba(%d,%d,%d,%f)", cmap.getEndColor().getRed(), cmap.getEndColor().getGreen(), cmap.getEndColor().getBlue(), ((double) cmap.getEndColor().getAlpha() / 255.0d)),
cmap.getMinSignal(),
cmap.getMaxSignal()
);
Expand Down

0 comments on commit 3f8c50a

Please sign in to comment.