242 {
244
245 float dx = fTwoFifthsSizeX * std::cos(fCurrentAngle);
246 float dy = fTwoFifthsSizeX * std::sin(fCurrentAngle);
247
248 float colorStopStep =
SkScalarInterp(-.1f, .1f, fCurrentGradientStep);
250
252 brightnessStep,
253 (brightnessStep << 1),
254 102);
256 (brightnessStep << 1),
257 brightnessStep,
258 102);
262 };
264 color1Step,
265 color1Step,
266 color2Step,
267 color2Step
268 };
270 0,
271 0.2f + colorStopStep,
272 0.8f - colorStopStep,
273 1
274 };
277
279 paint.setAntiAlias(
true);
280 paint.setStrokeWidth(15);
281 for (
int i = 0;
i < 4;
i++) {
282 const SkColor strokeColors[] = {
283 0xffe01040, 0xff10c030, 0xff744cba, 0xffe05010
284 };
286 0xff70051d, 0xff016112, 0xff2F0C6E, 0xff702701
287 };
288 paint.setColor(strokeColors[
i]);
295 paint.setColor(fillColors[
i]);
298 paint.setShader(gradientShader);
300 paint.setShader(
nullptr);
301 }
302
304 }
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorWHITE
#define SkScalarRoundToInt(x)
static SkScalar SkScalarInterp(SkScalar A, SkScalar B, SkScalar t)
void clear(SkColor color)
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
virtual void draw(SkCanvas *canvas)
PODArray< SkColor > colors
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)