Skip to content

Most visited

Recently visited

navigation

RadialGradient

public class RadialGradient
extends Shader

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


Summary

Public constructors

RadialGradient(float centerX, float centerY, float radius, int[] colors, float[] stops, Shader.TileMode tileMode)

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

RadialGradient(float centerX, float centerY, float radius, int centerColor, int edgeColor, Shader.TileMode tileMode)

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

Inherited methods

From class android.graphics.Shader
From class java.lang.Object

Public constructors

RadialGradient

added in API level 1
RadialGradient (float centerX, 
                float centerY, 
                float radius, 
                int[] colors, 
                float[] stops, 
                Shader.TileMode tileMode)

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

Parameters
centerX float: The x-coordinate of the center of the radius

centerY float: The y-coordinate of the center of the radius

radius float: Must be positive. The radius of the circle for this gradient.

colors int: The colors to be distributed between the center and edge of the circle

This value must never be null.

stops float: May be null. Valid values are between 0.0f and 1.0f. The relative position of each corresponding color in the colors array. If null, colors are distributed evenly between the center and edge of the circle.

tileMode Shader.TileMode: The Shader tiling mode

This value must never be null.

RadialGradient

added in API level 1
RadialGradient (float centerX, 
                float centerY, 
                float radius, 
                int centerColor, 
                int edgeColor, 
                Shader.TileMode tileMode)

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

Parameters
centerX float: The x-coordinate of the center of the radius

centerY float: The y-coordinate of the center of the radius

radius float: Must be positive. The radius of the circle for this gradient

centerColor int: The color at the center of the circle.

edgeColor int: The color at the edge of the circle.

tileMode Shader.TileMode: The Shader tiling mode

This value must never be null.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)