Package micycle.peasygradients.gradient
Class ColorStop
- java.lang.Object
-
- micycle.peasygradients.gradient.ColorStop
-
- All Implemented Interfaces:
Comparable<ColorStop>
public final class ColorStop extends Object implements Comparable<ColorStop>
A container for color (in every color space) and the percentage position that it occurs within a gradient. Gradients comprise multiple color stops.- Author:
- Michael Carleton
-
-
Constructor Summary
Constructors Constructor Description ColorStop(int clr, float fraction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ColorStop other)
Enables color stops to be sorted by Collections.sort via pairwise comparison on the percent of each stop.boolean
equals(Object obj)
double[]
getColor(ColorSpace colorSpace)
Return the value of the colorstop in a given colorspaceint
hashCode()
protected void
mutate(float amt)
String
toString()
-
-
-
Method Detail
-
getColor
public double[] getColor(ColorSpace colorSpace)
Return the value of the colorstop in a given colorspace- Parameters:
colorSpace
-- Returns:
- double[a, b, c] representing color in given colorspace
-
mutate
protected void mutate(float amt)
-
compareTo
public int compareTo(ColorStop other)
Enables color stops to be sorted by Collections.sort via pairwise comparison on the percent of each stop.- Specified by:
compareTo
in interfaceComparable<ColorStop>
-
-