}
-/**
- * Returns a colour three shades darker.
- *
- * We use darker text to indicate unselected buttons, lighter text for selected. Note you can't
- * guarantee that darkerThan/brighterThan undo each other, as they may result in black/white.
+ /**
+ * 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.darker().darker().darker();
+ public static Color darkerThan(Color col)
+ {
+ return col == null ? null : col.darker().darker().darker();
}
-/**
- * Returns a colour three shades brighter.
+ /**
+ * Returns a colour three shades brighter. Note you can't guarantee that
+ * darkerThan reverses this, as brighterThan may result in white.
*
- * We use darker text to indicate unselected buttons, lighter text for selected. Note you can't
- * guarantee that darkerThan/brighterThan undo each other, as they may result in black/white.
* @param col
* @return
*/
- public static Color brighterThan(Color col) {
- return col.brighter().brighter().brighter();
+ public static Color brighterThan(Color col)
+ {
+ return col == null ? null : col.brighter().brighter().brighter();
}
}