From: Ben Soares Date: Thu, 7 Nov 2024 13:00:20 +0000 (+0000) Subject: JAL-4386 Fixed to the colour scheme ranges and application to the normal calculated... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d7373aec5cf3ffb5729d7481092f5cf91dc6a7ea;p=jalview.git JAL-4386 Fixed to the colour scheme ranges and application to the normal calculated tree --- diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index fbb0a7d..7d0222f 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1266,8 +1266,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, for (int i = 0; i < groups.size(); i++) { String colId = groups.get(i).getNodeName(); - Color col = ColorUtils.getColourFromNameAndScheme(colId, - "AVOID_GREEN"); + Color col = ColorUtils.getDefaultColourFromName(colId); setColor(groups.get(i), col.brighter()); diff --git a/src/jalview/util/ColorUtils.java b/src/jalview/util/ColorUtils.java index 6d55302..73ad0ef 100644 --- a/src/jalview/util/ColorUtils.java +++ b/src/jalview/util/ColorUtils.java @@ -420,20 +420,21 @@ public class ColorUtils public enum ColourScheme { - AVOID_RED, AVOID_GREEN, AVOID_BLUE, SATURATED, DESATURATED, GREYSCALE, - BRIGHT, DARK + AVOID_RED, AVOID_GREEN, AVOID_BLUE, SATURATED, DESATURATED, GREYISH, + GREYSCALE, BRIGHT, MEDIUM, DARK } public static float[] getHSBRanges(String colourScheme) { float Hmin = 0.0f; float Hmax = 1.0f; - float Smin = 0.7f; + float Smin = 0.6f; float Smax = 1.0f; - float Bmin = 0.7f; + float Bmin = 0.6f; float Bmax = 1.0f; for (String scheme : colourScheme.split(",")) { + Console.debug("Applying colourScheme component " + scheme); ColourScheme cs; try { @@ -455,8 +456,8 @@ public class ColorUtils Hmax = 0.18f; break; case AVOID_BLUE: - Hmin = 0.51f; - Hmax = 0.81f; + Hmin = 0.81f; + Hmax = 0.51f; break; case SATURATED: Smin = 1.0f; @@ -464,18 +465,27 @@ public class ColorUtils break; case DESATURATED: Smin = 0.2f; - Smax = 0.7f; + Smax = 0.6f; break; + case GREYISH: + Smin = 0.0f; + Smax = 0.2f; case GREYSCALE: Smin = 0.0f; Smax = 0.0f; + Bmin = 0.1f; + Bmax = 0.9f; + break; case BRIGHT: Bmin = 1.0f; - Bmax = 0.9f; + Bmax = 1.0f; break; + case MEDIUM: + Bmin = 0.6f; + Bmax = 0.8f; case DARK: - Bmin = 0.2f; - Bmax = 0.6f; + Bmin = 0.1f; + Bmax = 0.4f; break; } }