public class JHelpGradientHorizontal extends java.lang.Object implements JHelpPaint
Modifier and Type | Class and Description |
---|---|
class |
JHelpGradientHorizontal.Percent
Represents a step
|
Modifier and Type | Field and Description |
---|---|
private SortedArray<JHelpGradientHorizontal.Percent> |
percents
Gradient steps
|
private int |
width
Width of the current shape to fill
|
Constructor and Description |
---|
JHelpGradientHorizontal(int colorStart,
int colorEnd)
Create a new instance of JHelpGradientHorizontal
|
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. |
JHelpGradientHorizontal.Percent[] |
otainPercents()
Steps list
|
private final SortedArray<JHelpGradientHorizontal.Percent> percents
private int width
public JHelpGradientHorizontal(int colorStart, int colorEnd)
colorStart
- Color at start (left)colorEnd
- Color at end (right)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 JHelpGradientHorizontal.Percent[] otainPercents()