| 1 |
// 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 "tools/fiddle/examples.h" |
| 4 |
REG_FIDDLE(Color_Methods, 256, 128, false, 0) { |
| 5 |
void draw(SkCanvas* canvas) { |
| 6 |
SkPaint paint; |
| 7 |
paint.setColor(0x8000FF00); // transparent green |
| 8 |
canvas->drawCircle(50, 50, 40, paint); |
| 9 |
paint.setARGB(128, 255, 0, 0); // transparent red |
| 10 |
canvas->drawCircle(80, 50, 40, paint); |
| 11 |
paint.setColor(SK_ColorBLUE); |
| 12 |
paint.setAlpha(0x80); |
| 13 |
canvas->drawCircle(65, 65, 40, paint); |
| 14 |
} |
| 15 |
} // END FIDDLE |