Package toxi.color
Class Hue
java.lang.Object
toxi.color.Hue
This class defines color hues and allows them to be access by name. There are
also methods to check if a hue is one of the 7 primary hues (rainbow) or to
find the closest defined hue for a given color.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Hue
static final Hue
static final Hue
static final Hue
static final Hue
static final Hue
static final Hue
static final Hue
static float
Tolerance value for checking if a given hue is primary (default 0.01)static final Hue
static final Hue
static final Hue
static final Hue
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Hue
getClosest
(float hue, boolean primaryOnly) Finds the closest defined & named Hue for the given hue value.static final Hue
getForName
(String name) float
getHue()
getName()
boolean
static boolean
isPrimary
(float hue) static boolean
isPrimary
(float hue, float variance) toString()
-
Field Details
-
RED
-
ORANGE
-
YELLOW
-
LIME
-
GREEN
-
TEAL
-
CYAN
-
AZURE
-
BLUE
-
INDIGO
-
PURPLE
-
PINK
-
PRIMARY_VARIANCE
public static float PRIMARY_VARIANCETolerance value for checking if a given hue is primary (default 0.01)
-
-
Constructor Details
-
Hue
-
Hue
-
-
Method Details
-
getClosest
Finds the closest defined & named Hue for the given hue value. Optionally, the search can be limited to primary hues only.- Parameters:
hue
- normalized hue (0.0 ... 1.0) will be automatically wrappedprimaryOnly
- only consider the 7 primary hues- Returns:
- closest Hue instance
-
getForName
-
isPrimary
public static boolean isPrimary(float hue) -
isPrimary
public static boolean isPrimary(float hue, float variance) -
getHue
public float getHue() -
getName
-
isPrimary
public boolean isPrimary() -
toString
-