Color_Methods.cpp 620 B

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