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 Color
darker(Color color, double fraction)
Make a color darker.static Color
getIntermediate(Color start, Color end, int stepSize, int position)
static Color
lighter(Color color, double fraction)
Make a color lighter.static void
main(String[] args)
static Color
rotateHue(Color color, float fraction)
Rotate a color through HSB spacestatic String
toHexColor(Color col)
-
-
-
Constructor Detail
-
ColorUtils
public ColorUtils()
-
-
Method Detail
-
toHexColor
public static String toHexColor(Color col)
-
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.
-
-