13 {
14 canvas->clipRect({0,0,500,500});
18 float pos[6] = {0, 2/6.f, 3/6.f, 4/6.f, 5/6.f, 1};
23 canvas->drawPaint(grad);
24
29
30 auto drawLine = [&](
float x0,
float y0,
float x1,
float y1,
float w) {
36 };
37
38 drawLine(20, 20, 200, 120, 20);
39 drawLine(20, 200, 20, 100, 20);
40 drawLine(480, 20, 400, 400, 20);
41 drawLine(50, 480, 260, 100, 20);
42 drawLine(270, 20, 380, 210, 20);
43 drawLine(280, 280, 400, 480, 20);
44 drawLine(160, 375, 280, 375, 20);
45 drawLine(220, 410, 220, 470, 20);
46 drawLine(250, 250, 250, 250, 20);
47}
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kLines_PointMode
draw each pair of points as a line segment
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setStrokeCap(Cap cap)
void setShader(sk_sp< SkShader > shader)
void setStrokeWidth(SkScalar width)
PODArray< SkColor > colors