blob: 4e265ab6361fc24beeb41da7ca47e50cf717aabc [file] [log] [blame]
Hal Canary83c2f702019-03-07 14:53:03 -05001// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3#include "fiddle/examples.h"
4// HASH=c015dc2010c15e1c00b4f7330232b0f7
5REG_FIDDLE(Paint_062, 256, 256, false, 0) {
6void draw(SkCanvas* canvas) {
7 SkPaint paint;
8 SkPoint center = { 50, 50 };
9 SkScalar radius = 50;
10 const SkColor colors[] = { 0xFFFFFFFF, 0xFF000000 };
11 paint.setShader(SkGradientShader::MakeRadial(center, radius, colors,
12 nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));
13 for (SkScalar a : { 0.3f, 0.6f, 1.0f } ) {
14 paint.setAlpha((int) (a * 255));
15 canvas->drawCircle(center.fX, center.fY, radius, paint);
16 canvas->translate(70, 70);
17 }
18}
19} // END FIDDLE