public class ColorUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ColorUtils.GradientStop |
Modifier and Type | Field and Description |
---|---|
static Color |
BLACK_TRANSPARENT |
static Map<String,Color> |
COLOR_MAP |
static String |
PARSE_COLOR_DESCRIPTION |
static Color |
WHITE_TRANSPARENT |
Constructor and Description |
---|
ColorUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
colorToHexString(Color color)
Converts a color to a Hex string
|
static Color |
hexStringToColor(String s)
Converts a hex color string #RRGGBB or #RRGGBBAA to a color
|
static Color |
parseColor(String colorString)
Parses a color
|
static Color[] |
renderGradient(List<ColorUtils.GradientStop> stops,
int numColors) |
static Color |
scaleHSV(Color color,
float hFactor,
float sFactor,
float vFactor)
Applies scaling in HSV space
|
static Color |
setAlpha(Color color,
int alpha) |
public static final String PARSE_COLOR_DESCRIPTION
public static Color WHITE_TRANSPARENT
public static Color BLACK_TRANSPARENT
public static Color scaleHSV(Color color, float hFactor, float sFactor, float vFactor)
color
- the colorhFactor
- factor for HsFactor
- factor for SvFactor
- factor for Vpublic static Color parseColor(String colorString)
colorString
- the color stringpublic static String colorToHexString(Color color)
color
- the colorpublic static Color hexStringToColor(String s)
s
- the stringpublic static Color[] renderGradient(List<ColorUtils.GradientStop> stops, int numColors)
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.