Flutter Engine
The Flutter Engine
Functions
radial_gradient_shader_with_animated_color.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE_ANIMATED (radial_gradient_shader_with_animated_color, 256, 256, false, 0, 2)
 

Function Documentation

◆ REG_FIDDLE_ANIMATED()

REG_FIDDLE_ANIMATED ( radial_gradient_shader_with_animated_color  ,
256  ,
256  ,
false  ,
,
 
)

Definition at line 4 of file radial_gradient_shader_with_animated_color.cpp.

4 {
5void 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};
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
constexpr SkColor SK_ColorYELLOW
Definition: SkColor.h:139
uint32_t SkColor
Definition: SkColor.h:37
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawPaint(const SkPaint &paint)
Definition: SkCanvas.cpp:1668
static sk_sp< SkShader > MakeRadial(const SkPoint &center, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
const Paint & paint
Definition: color_source.cc:38
double frame
Definition: examples.cpp:31
PODArray< SkColor > colors
Definition: SkRecords.h:276
static constexpr SkPoint Make(float x, float y)
Definition: SkPoint_impl.h:173