Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

RadialGradient

extends Shader
java.lang.Object
   ↳ android.graphics.Shader
     ↳ android.graphics.RadialGradient

Summary

Public Constructors
RadialGradient (float x, float y, float radius, int[] colors, float[] positions, Shader.TileMode tile)
Create a shader that draws a radial gradient given the center and radius.
RadialGradient (float x, float y, float radius, int color0, int color1, Shader.TileMode tile)
Create a shader that draws a radial gradient given the center and radius.
[Expand]
Inherited Methods
From class android.graphics.Shader
From class java.lang.Object

Public Constructors

public RadialGradient (float x, float y, float radius, int[] colors, float[] positions, Shader.TileMode tile)

Added in API level 1

Create a shader that draws a radial gradient given the center and radius.

Parameters
x The x-coordinate of the center of the radius
y The y-coordinate of the center of the radius
radius Must be positive. The radius of the circle for this gradient
colors The colors to be distributed between the center and edge of the circle
positions May be NULL. The relative position of each corresponding color in the colors array. If this is NULL, the the colors are distributed evenly between the center and edge of the circle.
tile The Shader tiling mode

public RadialGradient (float x, float y, float radius, int color0, int color1, Shader.TileMode tile)

Added in API level 1

Create a shader that draws a radial gradient given the center and radius.

Parameters
x The x-coordinate of the center of the radius
y The y-coordinate of the center of the radius
radius Must be positive. The radius of the circle for this gradient
color0 The color at the center of the circle.
color1 The color at the edge of the circle.
tile The Shader tiling mode