public class JHelpGradientVertical extends java.lang.Object implements JHelpPaint
Modifier and Type | Class and Description |
---|---|
class |
JHelpGradientVertical.Percent
Represents a step
|
Modifier and Type | Field and Description |
---|---|
private int |
height
Height of the current shape to fill
|
private SortedArray<JHelpGradientVertical.Percent> |
percents
Gradient steps
|
Constructor and Description |
---|
JHelpGradientVertical(int colorStart,
int colorEnd)
Create a new instance of JHelpGradientVertical
|
Modifier and Type | Method and Description |
---|---|
void |
addColor(int percent,
int color)
Add a color step
|
void |
initializePaint(int width,
int height)
Called when the gradient is about to be used
Parent documentation: Initialize the shape. |
int |
obtainColor(int x,
int y)
Compute a pixel color
Parent documentation: Compute color to use for a specific point. |
JHelpGradientVertical.Percent[] |
otainPercents()
Steps list
|
private int height
private final SortedArray<JHelpGradientVertical.Percent> percents
public JHelpGradientVertical(int colorStart, int colorEnd)
colorStart
- Color a start (up)colorEnd
- Color at end (down)public void addColor(int percent, int color)
percent
- Percent of the stepcolor
- Step colorpublic void initializePaint(int width, int height)
initializePaint
in interface JHelpPaint
width
- Area widthheight
- Area heightJHelpPaint.initializePaint(int, int)
public int obtainColor(int x, int y)
obtainColor
in interface JHelpPaint
x
- X positiony
- Y positionJHelpPaint.obtainColor(int, int)
public JHelpGradientVertical.Percent[] otainPercents()