240 {
242
243 float dx = fTwoFifthsSizeX * std::cos(fCurrentAngle);
244 float dy = fTwoFifthsSizeX * std::sin(fCurrentAngle);
245
246 float colorStopStep =
SkScalarInterp(-.1f, .1f, fCurrentGradientStep);
248
250 brightnessStep,
251 (brightnessStep << 1),
252 102);
254 (brightnessStep << 1),
255 brightnessStep,
256 102);
260 };
262 color1Step,
263 color1Step,
264 color2Step,
265 color2Step
266 };
268 0,
269 0.2f + colorStopStep,
270 0.8f - colorStopStep,
271 1
272 };
275
277 paint.setAntiAlias(
true);
278 paint.setStrokeWidth(15);
279 for (int i = 0; i < 4; i++) {
280 const SkColor strokeColors[] = {
281 0xffe01040, 0xff10c030, 0xff744cba, 0xffe05010
282 };
284 0xff70051d, 0xff016112, 0xff2F0C6E, 0xff702701
285 };
286 paint.setColor(strokeColors[i]);
293 paint.setColor(fillColors[i]);
296 paint.setShader(gradientShader);
298 paint.setShader(
nullptr);
299 }
300
302 }
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)