Package paintingcanvas.misc
Class Misc
- java.lang.Object
-
- paintingcanvas.misc.Misc
-
public class Misc extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Misc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
castDrawable(Drawable<?> drawable, java.lang.Class<T> _class)
static <N extends java.lang.Number>
Nclamp(N min, N val, N max)
static <N extends java.lang.Number>
booleanequality(N a, N b, N error)
static java.awt.Color
stringToColor(java.lang.String name)
Set the color of the object with a certain color by name, or by a hex code.
-
-
-
Method Detail
-
clamp
public static <N extends java.lang.Number> N clamp(N min, N val, N max)
-
equality
public static <N extends java.lang.Number> boolean equality(N a, N b, N error)
-
stringToColor
public static java.awt.Color stringToColor(java.lang.String name)
Set the color of the object with a certain color by name, or by a hex code. string.- Parameters:
name
- the string describing the hue or the hex code- Returns:
- the color
- See Also:
for list of all valid names
-
castDrawable
public static <T> T castDrawable(Drawable<?> drawable, java.lang.Class<T> _class)
-
-