The OpenD Programming Language

RadialGradient

A radial gradient.

Use the this(Point!double c0, double radius0, Point!double c1, double radius1) constructor to create an instance.

Constructors

this
this(cairo_pattern_t* ptr)

Create a RadialGradient from a existing cairo_pattern_t*. RadialGradient is a garbage collected class. It will call cairo_pattern_destroy when it gets collected by the GC or when dispose() is called.

this
this(Point!double c0, double radius0, Point!double c1, double radius1)
this(double c0x, double c0y, double radius0, double c1x, double c1y, double radius1)

Creates a new radial gradient pattern between the two circles defined by (c0, radius0) and (c1, radius1). Before using the gradient pattern, a number of color stops should be defined using Pattern.addColorStopRGB() or Pattern.addColorStopRGBA().

Members

Functions

getRadialCircles
void getRadialCircles(Point!double c0, Point!double c1, double radius0, double radius1)

Gets the gradient endpoint circles for a radial gradient, each specified as a center coordinate and a radius.

Inherited Members

From Gradient

addColorStopRGB
void addColorStopRGB(double offset, RGB color)
void addColorStopRGB(double offset, double red, double green, double blue)

Adds an opaque color stop to a gradient pattern. The offset specifies the location along the gradient's control vector. For example, a LinearGradient's control vector is from (x0,y0) to (x1,y1) while a RadialGradient's control vector is from any point on the start circle to the corresponding point on the end circle.

addColorStopRGBA
void addColorStopRGBA(double offset, RGBA color)
void addColorStopRGBA(double offset, double red, double green, double blue, double alpha)

Adds a translucent color stop to a gradient pattern. The offset specifies the location along the gradient's control vector. For example, a linear gradient's control vector is from (x0,y0) to (x1,y1) while a radial gradient's control vector is from any point on the start circle to the corresponding point on the end circle.

getColorStopCount
int getColorStopCount()

Gets the number of color stops specified in the given gradient pattern.

colorStopCount
alias colorStopCount = getColorStopCount

Convenience alias

getColorStopRGBA
void getColorStopRGBA(int index, double offset, RGBA color)

Gets the color and offset information at the given index for a gradient pattern. Values of index are 0 to 1 less than the number returned by getColorStopCount().

Meta