Class GradientColorStop
java.lang.Object
com.itextpdf.kernel.colors.gradients.GradientColorStop
The gradient stop color structure representing the stop color configuration. The stop color consists of: -
float[] rgb color array. Values should be in [0, 1] range. All values outside of this range would be adjusted to the nearest corner of the range. - double offset and GradientColorStop.OffsetType offset type specifies the coordinate of the stop color on the targeting gradient coordinates vector - double hint offset and GradientColorStop.HintOffsetType hint offset type specifies the color transition mid point offset between the current color and the next color
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the possible hint offset typestatic enumRepresents the possible offset type -
Constructor Summary
ConstructorsConstructorDescriptionGradientColorStop(float[] rgb) Constructor of stop color with with specified rgb color and default (GradientColorStop.OffsetType.AUTO) offsetGradientColorStop(float[] rgb, double offset, GradientColorStop.OffsetType offsetType) Constructor of stop color with with specified rgb color and offsetGradientColorStop(GradientColorStop gradientColorStop, double offset, GradientColorStop.OffsetType offsetType) Constructor that creates the stop with the same color as the another stop and new offset -
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleGet the hint offset valueGet the hint offset typedoubleGet the offset valueGet the offset typefloat[]Get the stop color rgb valueinthashCode()setHint(double hintOffset, GradientColorStop.HintOffsetType hintOffsetType) Set the color hint specified by its value and type (more details).setOffset(double offset, GradientColorStop.OffsetType offsetType) Set the offset specified by its value and type
-
Constructor Details
-
GradientColorStop
public GradientColorStop(float[] rgb) Constructor of stop color with with specified rgb color and default (GradientColorStop.OffsetType.AUTO) offset- Parameters:
-
rgb- the color value
-
GradientColorStop
Constructor of stop color with with specified rgb color and offset- Parameters:
-
rgb- the color value -
offset- the offset value. Makes sense only if theoffsetTypeis notGradientColorStop.OffsetType.AUTO -
offsetType- the offset's type
-
GradientColorStop
public GradientColorStop(GradientColorStop gradientColorStop, double offset, GradientColorStop.OffsetType offsetType) Constructor that creates the stop with the same color as the another stop and new offset- Parameters:
-
gradientColorStop- the gradient stop color from which the color value would be copied -
offset- the new offset. Makes sense only if theoffsetTypeis notGradientColorStop.OffsetType.AUTO -
offsetType- the new offset's type
-
-
Method Details
-
getRgbArray
public float[] getRgbArray()Get the stop color rgb value- Returns:
- the copy of stop's rgb value
-
getOffsetType
Get the offset type- Returns:
- the offset type
-
getOffset
public double getOffset()Get the offset value- Returns:
- the offset value
-
getHintOffset
public double getHintOffset()Get the hint offset value- Returns:
- the hint offset value
-
getHintOffsetType
Get the hint offset type- Returns:
- the hint offset type
-
setOffset
Set the offset specified by its value and type- Parameters:
-
offset- the offset's value to be set. Makes sense only if theoffsetTypeis notGradientColorStop.OffsetType.AUTO -
offsetType- the offset's type to be set - Returns:
-
the current
GradientColorStopinstance
-
setHint
public GradientColorStop setHint(double hintOffset, GradientColorStop.HintOffsetType hintOffsetType) Set the color hint specified by its value and type (more details).- Parameters:
-
hintOffset- the hint offset's value to be set. Makes sense only if thehintOffsetTypeis notGradientColorStop.HintOffsetType.NONE -
hintOffsetType- the hint offset's type to be set - Returns:
-
the current
GradientColorStopinstance
-
equals
-
hashCode
public int hashCode()
-