Merge branch 'JAL-1360_Branch' into Release_2_8_2_Branch
[jalview.git] / src / jalview / util / ColorUtils.java
index f108da1..fd76086 100644 (file)
@@ -59,4 +59,28 @@ public class ColorUtils
 
   }
 
+  /**
+   * Returns a colour three shades darker. Note you can't guarantee that
+   * brighterThan reverses this, as darkerThan may result in black.
+   * 
+   * @param col
+   * @return
+   */
+  public static Color darkerThan(Color col)
+  {
+    return col == null ? null : col.darker().darker().darker();
+  }
+
+  /**
+   * Returns a colour three shades brighter. Note you can't guarantee that
+   * darkerThan reverses this, as brighterThan may result in white.
+   * 
+   * @param col
+   * @return
+   */
+  public static Color brighterThan(Color col)
+  {
+    return col == null ? null : col.brighter().brighter().brighter();
+  }
+
 }