Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1.  private Canvas trinagle(String shape, String color, int size) {
  2.         Canvas canvas = new Canvas(300, 300);
  3.         GraphicsContext gc = canvas.getGraphicsContext2D();
  4.         gc.clearRect(0, 0, 350, 350);
  5.  
  6.         gc.beginPath();
  7.         gc.moveTo(size * 0.5, 0);
  8.         gc.lineTo(size, size);
  9.         gc.lineTo(0, size);
  10.         gc.lineTo(size * 0.5, 0);
  11.         gc.setFill(Color.valueOf(color));
  12.         gc.setStroke(Color.valueOf(color));
  13.         gc.stroke();
  14.         return canvas;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement