|
Wt
4.10.4
|
A linear or radial gradient. More...
#include <Wt/WGradient.h>
Classes | |
| class | ColorStop |
| A gradient color stop. More... | |
Public Member Functions | |
| WGradient () | |
| Default constructor. | |
| GradientStyle | style () const |
| Returns the gradient style. | |
| bool | isEmpty () const |
| Returns whether the gradient is empty. | |
| void | setLinearGradient (double x0, double y0, double x1, double y1) |
| Configures a linear gradient. | |
| void | setRadialGradient (double cx, double cy, double r, double fx, double fy) |
| Configures a radial gradient. | |
| void | addColorStop (double position, const WColor &color) |
| Adds a color stop. | |
| void | addColorStop (const ColorStop &colorstop) |
| Adds a color stop. | |
| void | clearColorStops () |
| Removes all color stops. | |
| const std::vector< ColorStop > & | colorstops () const |
| Returns the color stops. | |
| const WLineF & | linearGradientVector () const |
| Returns the line positioning the linear gradient. | |
| const WPointF & | radialCenterPoint () const |
| Returns the center of a radial gradient. | |
| const WPointF & | radialFocalPoint () const |
| Returns the focal point of a radial gradient. | |
| double | radialRadius () const |
| Returns the radius of a radial gradient. | |
| bool | operator== (const WGradient &other) const |
| Comparison operator. | |
| bool | operator!= (const WGradient &other) const |
| Comparison operator. | |
A linear or radial gradient.
| Wt::WGradient::WGradient | ( | ) |
Default constructor.
Creates an empty linear gradient from (0,0) to (1,1) (without color stops).
Adds a color stop.
Adds a color stop.
Adds a color stop.
For a linear gradient, the position is relative to the position on the line (from 0 to 1 corresponding to p0 to p1).
For a radial gradient, the position indicates the distance from the center (from 0 to 1 corresponding to center to radius).
| void Wt::WGradient::clearColorStops | ( | ) |
Removes all color stops.
Returns the color stops.
| bool Wt::WGradient::isEmpty | ( | ) | const |
Returns whether the gradient is empty.
A gradient is empty if no color stops are defined.
Returns the line positioning the linear gradient.
This returns the line set in setLinearGradient().
Returns the center of a radial gradient.
This returns the center point set in setRadialGradient().
Returns the focal point of a radial gradient.
This returns the focal point set in setRadialGradient().
| double Wt::WGradient::radialRadius | ( | ) | const |
Returns the radius of a radial gradient.
This returns the radius set in setRadialGradient().
Configures a linear gradient.
The coordinates describe a line which provides an origin and orientation of the gradient in user-space coordinates.
Configures a radial gradient.
A radial gradient is described by a center, a radial and a focus point. All coordinates are user-space coordinates.
| GradientStyle Wt::WGradient::style | ( | ) | const |
Returns the gradient style.