Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / docs / examples / radial_gradient_shader_with_animated_color.cpp
1 // Copyright 2020 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 "tools/fiddle/examples.h"
4 REG_FIDDLE_ANIMATED(radial_gradient_shader_with_animated_color, 256, 256, false, 0, 2) {
5 void draw(SkCanvas* canvas) {
6     float p = 0.5 * (1 - cos(6.28318548f * frame));
7     SkColor blue = SkColor(0xff * p) | 0xFF000000;
8     SkColor colors[2] = {blue, SK_ColorYELLOW};
9     SkPaint paint;
10     paint.setShader(SkGradientShader::MakeRadial(
11                 SkPoint::Make(128.0f, 128.0f), 180.0f,
12                 colors, nullptr, 2, SkTileMode::kClamp, 0, nullptr));
13     canvas->drawPaint(paint);
14 }
15 }  // END FIDDLE