iText 8.0.5 API
iText.Kernel.Colors.Gradients.GradientColorStop Class Reference

The gradient stop color structure representing the stop color configuration. More...

Public Types

enum   OffsetType { OffsetType.ABSOLUTE, OffsetType.AUTO, OffsetType.RELATIVE }
  Represents the possible offset type More...
 
enum   HintOffsetType { HintOffsetType.ABSOLUTE_ON_GRADIENT, HintOffsetType.RELATIVE_ON_GRADIENT, HintOffsetType.RELATIVE_BETWEEN_COLORS, HintOffsetType.NONE }
  Represents the possible hint offset type More...
 

Public Member Functions

  GradientColorStop (float[] rgb)
  Constructor of stop color with with specified rgb color and default ( OffsetType.AUTO ) offset More...
 
  GradientColorStop (float[] rgb, double offset, GradientColorStop.OffsetType offsetType)
  Constructor of stop color with with specified rgb color and offset More...
 
  GradientColorStop (iText.Kernel.Colors.Gradients.GradientColorStop gradientColorStop, double offset, GradientColorStop.OffsetType offsetType)
  Constructor that creates the stop with the same color as the another stop and new offset More...
 
virtual float[]  GetRgbArray ()
  Get the stop color rgb value More...
 
virtual GradientColorStop.OffsetType  GetOffsetType ()
  Get the offset type More...
 
virtual double  GetOffset ()
  Get the offset value More...
 
virtual double  GetHintOffset ()
  Get the hint offset value More...
 
virtual GradientColorStop.HintOffsetType  GetHintOffsetType ()
  Get the hint offset type More...
 
virtual iText.Kernel.Colors.Gradients.GradientColorStop  SetOffset (double offset, GradientColorStop.OffsetType offsetType)
  Set the offset specified by its value and type More...
 
virtual iText.Kernel.Colors.Gradients.GradientColorStop  SetHint (double hintOffset, GradientColorStop.HintOffsetType hintOffsetType)
  Set the color hint specified by its value and type ( more details ). More...
 
override bool  Equals (Object o)
 
override int  GetHashCode ()
 

Detailed Description

The gradient stop color structure representing the stop color configuration.

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 OffsetType offset type specifies the coordinate of the stop color on the targeting gradient coordinates vector
  • double hint offset and HintOffsetType hint offset type specifies the color transition mid point offset between the current color and the next color

Member Enumeration Documentation

◆ HintOffsetType

Represents the possible hint offset type

Enumerator
ABSOLUTE_ON_GRADIENT 

The absolute hint offset value on the target gradient value

RELATIVE_ON_GRADIENT 

The relative hint offset value to the target coordinates vector.

The relative hint offset value to the target coordinates vector. The 0 value means the target vector start, the 1 value means the target vector end.

RELATIVE_BETWEEN_COLORS 

The relative hint offset value to the interval between the current gradient stop color and the next one.

NONE 

None hint offset specified

◆ OffsetType

Represents the possible offset type

Enumerator
ABSOLUTE 

The absolute offset value from the target coordinates vector's start

AUTO 

The automatic offset evaluation.

The automatic offset evaluation. The offset value should be evaluated automatically based on the whole stop colors list specified for the gradient. The general auto offset logic should be the next:

  • find the previous and the next specified offset or hint offset values
  • the sublist of sequent auto offsets should spread evenly between the found values
RELATIVE 

The relative offset value to the target coordinates vector.

The relative offset value to the target coordinates vector. The 0 value means the target vector start, the 1 value means the target vector end.

Constructor & Destructor Documentation

◆ GradientColorStop() [1/3]

iText.Kernel.Colors.Gradients.GradientColorStop.GradientColorStop ( float[]  rgb )
inline

Constructor of stop color with with specified rgb color and default ( OffsetType.AUTO ) offset

Parameters
rgb the color value

◆ GradientColorStop() [2/3]

iText.Kernel.Colors.Gradients.GradientColorStop.GradientColorStop ( float[]  rgb,
double  offset,
GradientColorStop.OffsetType  offsetType 
)
inline

Constructor of stop color with with specified rgb color and offset

Parameters
rgb the color value
offset the offset value. Makes sense only if the offsetType is not OffsetType.AUTO
offsetType the offset's type

◆ GradientColorStop() [3/3]

iText.Kernel.Colors.Gradients.GradientColorStop.GradientColorStop ( iText.Kernel.Colors.Gradients.GradientColorStop  gradientColorStop,
double  offset,
GradientColorStop.OffsetType  offsetType 
)
inline

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 the offsetType is not OffsetType.AUTO
offsetType the new offset's type

Member Function Documentation

◆ GetHintOffset()

virtual double iText.Kernel.Colors.Gradients.GradientColorStop.GetHintOffset ( )
inlinevirtual

Get the hint offset value

Returns
the hint offset value

◆ GetHintOffsetType()

virtual GradientColorStop.HintOffsetType iText.Kernel.Colors.Gradients.GradientColorStop.GetHintOffsetType ( )
inlinevirtual

Get the hint offset type

Returns
the hint offset type

◆ GetOffset()

virtual double iText.Kernel.Colors.Gradients.GradientColorStop.GetOffset ( )
inlinevirtual

Get the offset value

Returns
the offset value

◆ GetOffsetType()

virtual GradientColorStop.OffsetType iText.Kernel.Colors.Gradients.GradientColorStop.GetOffsetType ( )
inlinevirtual

Get the offset type

Returns
the offset type

◆ GetRgbArray()

virtual float [] iText.Kernel.Colors.Gradients.GradientColorStop.GetRgbArray ( )
inlinevirtual

Get the stop color rgb value

Returns
the copy of stop's rgb value

◆ SetHint()

virtual iText.Kernel.Colors.Gradients.GradientColorStop iText.Kernel.Colors.Gradients.GradientColorStop.SetHint ( double  hintOffset,
GradientColorStop.HintOffsetType  hintOffsetType 
)
inlinevirtual

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 the hintOffsetType is not HintOffsetType.NONE
hintOffsetType the hint offset's type to be set
Returns
the current GradientColorStop instance

◆ SetOffset()

virtual iText.Kernel.Colors.Gradients.GradientColorStop iText.Kernel.Colors.Gradients.GradientColorStop.SetOffset ( double  offset,
GradientColorStop.OffsetType  offsetType 
)
inlinevirtual

Set the offset specified by its value and type

Parameters
offset the offset's value to be set. Makes sense only if the offsetType is not OffsetType.AUTO
offsetType the offset's type to be set
Returns
the current GradientColorStop instance