Class ColorUtils
- java.lang.Object
-
- org.biojava.nbio.structure.gui.util.color.ColorUtils
-
public class ColorUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ColorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Colordarker(Color color, double fraction)Make a color darker.static ColorgetIntermediate(Color start, Color end, int stepSize, int position)static Colorlighter(Color color, double fraction)Make a color lighter.static voidmain(String[] args)static ColorrotateHue(Color color, float fraction)Rotate a color through HSB spacestatic StringtoHexColor(Color col)
-
-
-
Method Detail
-
main
public static void main(String[] args)
-
rotateHue
public static Color rotateHue(Color color, float fraction)
Rotate a color through HSB space- Parameters:
color- Starting colorfraction- Amount to add to the hue. The integer part is discarded to leave a number in [0,1)- Returns:
-
getIntermediate
public static Color getIntermediate(Color start, Color end, int stepSize, int position)
-
darker
public static Color darker(Color color, double fraction)
Make a color darker. (RGB color scheme)- Parameters:
color- Color to make darker.fraction- Darkness fraction.- Returns:
- Darker color.
-
-