Created
December 23, 2013 01:50
-
-
Save turnersr/8090726 to your computer and use it in GitHub Desktop.
Day 2, use of the the cascade operator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
import 'dart:math'; | |
void main() { | |
init_palau_flag(); | |
} | |
void init_palau_flag() { | |
palau_flag(); | |
} | |
void palau_flag(){ | |
CanvasElement palau_canvas = querySelector("#palau_flag"); | |
CanvasRenderingContext2D context = palau_canvas.context2D; | |
int width = palau_canvas.width; | |
int height = palau_canvas.height; | |
palau_canvas..width = width | |
..height = height; | |
context..fillStyle = "#4AADD6" | |
..fillRect(0,0,width,height); | |
context..fillStyle = "#FFDE00" | |
..arc(width/2.3, height/2, 40, 0, 2 * PI,false) | |
..fill(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment