JAL-4386 Fixed to the colour scheme ranges and application to the normal calculated...
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 7 Nov 2024 13:00:20 +0000 (13:00 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 7 Nov 2024 15:11:33 +0000 (15:11 +0000)
src/jalview/gui/TreeCanvas.java
src/jalview/util/ColorUtils.java

index fbb0a7d..7d0222f 100755 (executable)
@@ -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());
 
index 6d55302..73ad0ef 100644 (file)
@@ -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;
       }
     }