Skip to content

Commit

Permalink
improved color scheme of the links
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Wisser committed Nov 19, 2024
1 parent 01045a4 commit c7ee362
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/gui/net/sf/jailer/ui/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static void initColors() {
ColorAssoc_2_3.init(new Color(70, 255, 70));
ColorAssoc_2_4.init(new Color(245, 90, 60), new Color(235, 100, 70));
Color_153_153_153.init(new Color(153, 153, 153), ColorAssoc_2_2.dark);
Color_170_200_0.init(new Color(100, 130, 0), new Color(140, 150, 0)); // link join
Color_170_200_0.init(new Color(120, 140, 0), new Color(150, 160, 0)); // link join

Color_224_224_224.init(new Color(224, 224, 224), new Color(96, 96, 96));
Color_220_255_220.init(new Color(220, 255, 220), new Color(30, 61, 30));
Expand Down
19 changes: 11 additions & 8 deletions src/main/gui/net/sf/jailer/ui/databrowser/Desktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -2581,12 +2581,16 @@ private void paintLink(Point2D start, Point2D end, Color color, Color fgColor, G
g2d.setColor(inTempClosure && !pbg? Colors.Color_220_220_255 : color);
} else if (UIUtil.plaf.isFlat) {
double f = UIUtil.plaf == PLAF.FLATDARK? 0.5 : 3;
if (fgColor.getGreen() > fgColor.getRed() + fgColor.getBlue()) {
f = UIUtil.plaf == PLAF.FLATDARK? 0.6 : 1.5;
}
if (fgColor.getBlue() > fgColor.getRed() + fgColor.getGreen()) {
if (UIUtil.plaf == PLAF.FLATDARK) {
f = 0.7;
if (fgColor.getBlue() < 4 && fgColor.getGreen() > 99 && fgColor.getRed() > 99) {
f = UIUtil.plaf == PLAF.FLATDARK? 0.4 : 1.4;
} else {
if (fgColor.getGreen() > fgColor.getRed() + fgColor.getBlue()) {
f = UIUtil.plaf == PLAF.FLATDARK? 0.6 : 1.5;
}
if (fgColor.getBlue() > fgColor.getRed() + fgColor.getGreen()) {
if (UIUtil.plaf == PLAF.FLATDARK) {
f = 0.7;
}
}
}
g2d.setColor((inTempClosure) && pbg? new Color(
Expand Down Expand Up @@ -2632,7 +2636,6 @@ private void paintLink(Point2D start, Point2D end, Color color, Color fgColor, G
}
fgColorMapPlaf = UIUtil.plaf;
Color mc = fgColorMap.get(fg);

if (mc == null) {
HSLColor hslColor = new HSLColor(fg);
if (UIUtil.plaf == PLAF.FLATDARK) {
Expand All @@ -2648,7 +2651,7 @@ private void paintLink(Point2D start, Point2D end, Color color, Color fgColor, G
} else {
mc = hslColor
.adjustLuminance(fg.getBlue() > fg.getRed() && fg.getBlue() > fg.getGreen() ? 80
: fg.getGreen() > 130 && fg.getRed() > 130 && fg.getBlue() < 8 ? 40
: fg.getGreen() > 99 && fg.getRed() > 99 && fg.getBlue() < 8 ? 40
: fg.getGreen() > fg.getRed() && fg.getGreen() > fg.getBlue() ? 46
: fg.getGreen() > 130 && fg.getBlue() > 130 && fg.getRed() < 30
? 70
Expand Down

0 comments on commit c7ee362

Please sign in to comment.