blob: a385f84d3370c4e41cef2936ae9d2c0afad62dc1 [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=05383441e510d54008402e128fc8ad2b
5REG_FIDDLE(BlendMode_012, 256, 256, false, 0) {
6void draw(SkCanvas* canvas) {
7 canvas->drawColor(SK_ColorBLACK);
8 SkPaint paint;
9 paint.setBlendMode(SkBlendMode::kPlus);
10 for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN } ) {
11 SkColor colors[] = { color, SkColorSetA(color, 192), SkColorSetA(color, 128),
12 SkColorSetA(color, 0) };
13 paint.setShader(SkGradientShader::MakeRadial({ 64, 64}, 100,
14 colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));
15 canvas->drawCircle(64, 64, 100, paint);
16 canvas->translate(64, 64);
17 }
18}
19} // END FIDDLE