LinearGradient
public
class
LinearGradient
extends Shader
| java.lang.Object | ||
| ↳ | android.graphics.Shader | |
| ↳ | android.graphics.LinearGradient | |
Summary
Public constructors | |
|---|---|
LinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[] positions, Shader.TileMode tile)
Create a shader that draws a linear gradient along a line. |
|
LinearGradient(float x0, float y0, float x1, float y1, int color0, int color1, Shader.TileMode tile)
Create a shader that draws a linear gradient along a line. |
|
Inherited methods | |
|---|---|
android.graphics.Shader
| |
java.lang.Object
| |
Public constructors
LinearGradient
LinearGradient (float x0,
float y0,
float x1,
float y1,
int[] colors,
float[] positions,
Shader.TileMode tile)
Create a shader that draws a linear gradient along a line.
| Parameters | |
|---|---|
x0 |
float: The x-coordinate for the start of the gradient line |
y0 |
float: The y-coordinate for the start of the gradient line |
x1 |
float: The x-coordinate for the end of the gradient line |
y1 |
float: The y-coordinate for the end of the gradient line |
colors |
int: The colors to be distributed along the gradient lineThis value must never be |
positions |
float: May be null. The relative positions [0..1] of
each corresponding color in the colors array. If this is null,
the the colors are distributed evenly along the gradient line.This value may be |
tile |
Shader.TileMode: The Shader tiling mode
This value must never be |
LinearGradient
LinearGradient (float x0,
float y0,
float x1,
float y1,
int color0,
int color1,
Shader.TileMode tile)
Create a shader that draws a linear gradient along a line.
| Parameters | |
|---|---|
x0 |
float: The x-coordinate for the start of the gradient line |
y0 |
float: The y-coordinate for the start of the gradient line |
x1 |
float: The x-coordinate for the end of the gradient line |
y1 |
float: The y-coordinate for the end of the gradient line |
color0 |
int: The color at the start of the gradient line. |
color1 |
int: The color at the end of the gradient line. |
tile |
Shader.TileMode: The Shader tiling mode
This value must never be |
Interfaces
Classes
- Bitmap
- BitmapFactory
- BitmapFactory.Options
- BitmapRegionDecoder
- BitmapShader
- BlurMaskFilter
- Camera
- Canvas
- Color
- ColorFilter
- ColorMatrix
- ColorMatrixColorFilter
- ColorSpace
- ColorSpace.Connector
- ColorSpace.Rgb
- ColorSpace.Rgb.TransferParameters
- ComposePathEffect
- ComposeShader
- CornerPathEffect
- DashPathEffect
- DiscretePathEffect
- DrawFilter
- EmbossMaskFilter
- ImageFormat
- Interpolator
- LightingColorFilter
- LinearGradient
- MaskFilter
- Matrix
- Movie
- NinePatch
- Outline
- Paint
- Paint.FontMetrics
- Paint.FontMetricsInt
- PaintFlagsDrawFilter
- Path
- PathDashPathEffect
- PathEffect
- PathMeasure
- Picture
- PixelFormat
- Point
- PointF
- PorterDuff
- PorterDuffColorFilter
- PorterDuffXfermode
- RadialGradient
- Rect
- RectF
- Region
- RegionIterator
- Shader
- SumPathEffect
- SurfaceTexture
- SweepGradient
- Typeface
- Typeface.Builder
- Xfermode
- YuvImage
Enums
- Bitmap.CompressFormat
- Bitmap.Config
- BlurMaskFilter.Blur
- Canvas.EdgeType
- Canvas.VertexMode
- ColorSpace.Adaptation
- ColorSpace.Model
- ColorSpace.Named
- ColorSpace.RenderIntent
- Interpolator.Result
- Matrix.ScaleToFit
- Paint.Align
- Paint.Cap
- Paint.Join
- Paint.Style
- Path.Direction
- Path.FillType
- Path.Op
- PathDashPathEffect.Style
- PorterDuff.Mode
- Region.Op
- Shader.TileMode
Exceptions