auto result =
{
},
SpreadMode::Pad, Transform::identity());
paint.
shader = std::get<LinearGradient>(std::move(*result));
pb.
cubicTo(380.0f, 840.0f, 660.0f, 800.0f, 940.0f, 800.0f);
pb.
cubicTo(740.0f, 460.0f, 440.0f, 160.0f, 60.0f, 60.0f);
canvas.fillPath(*path, paint, FillRule::Winding);
Drawing surface backed by a mutable pixel buffer.
Definition Canvas.h:29
static Color fromRgba8(AlphaU8 red, AlphaU8 green, AlphaU8 blue, AlphaU8 alpha)
Creates from 8-bit components.
static std::optional< std::variant< Color, LinearGradient > > create(Point start, Point end, std::vector< GradientStop > stops, SpreadMode mode, Transform transform)
Creates a linear gradient between two points. Returns a Color if the gradient degenerates to a single...
Incrementally builds a Path from move/line/quad/cubic/close operations.
Definition PathBuilder.h:20
std::optional< Path > finish()
Builds and returns the immutable Path. Returns nullopt if empty or invalid.
PathBuilder & cubicTo(float x1, float y1, float x2, float y2, float x, float y)
Adds a cubic Bezier to (x, y) with control points (x1,y1) and (x2,y2).
PathBuilder & close()
Closes the current sub-path.
PathBuilder & lineTo(float x, float y)
Adds a line segment to (x, y).
PathBuilder & moveTo(float x, float y)
Begins a new sub-path at (x, y).
static std::optional< Pixmap > fromSize(std::uint32_t width, std::uint32_t height)
Creates a zero-filled pixmap. Returns nullopt for zero dimensions.
static GradientStop create(float position, Color color)
Creates a stop, clamping position to [0,1].
Definition Gradient.h:24
Controls how a shape is painted (shader, blend mode, anti-aliasing).
Definition Paint.h:15
bool antiAlias
Enable anti-aliased rendering. Default: true.
Definition Paint.h:23
Shader shader
Paint shader source. Default: solid black.
Definition Paint.h:17