JAL-4368 Only set a colour scheme if --colour is given or it's not a JVP file bug/JAL-4368_default_colourscheme_applied_to_JVP_inappropriately
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 5 Jan 2024 17:28:36 +0000 (17:28 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 5 Jan 2024 17:28:36 +0000 (17:28 +0000)
src/jalview/bin/Commands.java

index e01d40a..c848908 100644 (file)
@@ -328,9 +328,17 @@ public class Commands
           }
 
           // colour alignment
-          String colour = avm.getFromSubValArgOrPref(av, Arg.COLOUR, sv,
-                  null, "DEFAULT_COLOUR_PROT", "");
-          this.colourAlignFrame(af, colour);
+          String colour = null;
+          if (avm.containsArg(Arg.COLOUR)
+                  || !(format == FileFormat.Jalview))
+          {
+            colour = avm.getFromSubValArgOrPref(av, Arg.COLOUR, sv, null,
+                    "DEFAULT_COLOUR_PROT", null);
+          }
+          if (colour != null)
+          {
+            this.colourAlignFrame(af, colour);
+          }
 
           // Change alignment frame title
           String title = avm.getFromSubValArgOrPref(av, Arg.TITLE, sv, null,