Package pl.poznan.put.constant
Class Colors
java.lang.Object
pl.poznan.put.constant.Colors
A set of utility functions to work with palettes and color interpolation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Color[]
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].static String
toHexString
(Color color) static String
toSvgString
(Color color)
-
Method Details
-
getDistinctColors
- Returns:
- An array of 33 distinct colors.
-
interpolateColor
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
Color
from green-red spectrum which matches the value.
-
toHexString
- Parameters:
color
- Color to be converted.- Returns:
- A hex representation of the color.
-
toSvgString
- Parameters:
color
- Color to be converted.- Returns:
- An SVG representation of the color.
-