Package pl.poznan.put.constant
Class Colors
- java.lang.Object
-
- pl.poznan.put.constant.Colors
-
public final class Colors extends Object
A set of utility functions to work with palettes and color interpolation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Color[]getDistinctColors()static ColorinterpolateColor(double value, double min, double max)Interpolates a color in red-green spectrum from its value and a given range [min; max].static StringtoHexString(Color color)static StringtoSvgString(Color color)
-
-
-
Method Detail
-
getDistinctColors
public static Color[] getDistinctColors()
- Returns:
- An array of 33 distinct colors.
-
interpolateColor
public static Color interpolateColor(double value, double min, double max)
Interpolates a color in red-green spectrum from its value and a given range [min; max].- Parameters:
value- A value to use in interpolation.min- The beginning of range.max- The end of range.- Returns:
- An instance of
Colorfrom green-red spectrum which matches the value.
-
toHexString
public static String toHexString(Color color)
- Parameters:
color- Color to be converted.- Returns:
- A hex representation of the color.
-
-