diff --git a/examples/game/lib/sprite.dart b/examples/game/lib/sprite.dart index 2ddbbfdc6a4ef43b2e3448cb9351ec2e93de76f0..063522a8499f98e881e049804a3c8db27d27ecee 100644 --- a/examples/game/lib/sprite.dart +++ b/examples/game/lib/sprite.dart @@ -53,7 +53,7 @@ class Sprite extends NodeWithSize { // Setup paint object for opacity and transfer mode Paint paint = new Paint(); - paint.color = Color.fromARGB((255.0*_opacity).toInt(), 255, 255, 255); + paint.color = new Color.fromARGB((255.0*_opacity).toInt(), 255, 255, 255); if (colorOverlay != null) { paint.setColorFilter(new ColorFilter.mode(colorOverlay, TransferMode.srcATopMode)); } @@ -66,7 +66,7 @@ class Sprite extends NodeWithSize { else { // Paint a red square for missing texture canvas.drawRect(new Rect.fromLTRB(0.0, 0.0, size.width, size.height), - new Paint()..color = Color.fromARGB(255, 255, 0, 0)); + new Paint()..color = const Color.fromARGB(255, 255, 0, 0)); } canvas.restore(); } diff --git a/examples/raw/circle.sky b/examples/raw/circle.sky index c5818c6aec6aacddd9e4c55c3feeaedba4d9bca5..dcf725492289c81093450866a84be6a7c1b6238f 100644 --- a/examples/raw/circle.sky +++ b/examples/raw/circle.sky @@ -14,7 +14,7 @@ void main() { var element = document.getElementById('canvas'); element.requestPaint((PaintingContext context) { Paint paint = new Paint(); - paint.color = Color.fromARGB(128, 0, 255, 0); + paint.color = const Color.fromARGB(128, 0, 255, 0); double radius = math.min(context.width, context.height) / 2.0; context.drawCircle(context.width / 2.0, context.height / 2.0, radius, paint); context.commit(); diff --git a/examples/raw/custom_paint_without_element.sky b/examples/raw/custom_paint_without_element.sky index 72a6c2f41dba5a16de623d47ef8bac3d043e72da..cf36a2b4ed6086c86e4acbcbfef1472fc13c7843 100644 --- a/examples/raw/custom_paint_without_element.sky +++ b/examples/raw/custom_paint_without_element.sky @@ -9,7 +9,7 @@ void main() { PictureRecorder recorder = new PictureRecorder(width, height); double radius = min(width, height) * 0.45; - Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0); recorder.drawCircle(width / 2, height / 2, radius, paint); diff --git a/examples/raw/draw_picture_into_canvas.sky b/examples/raw/draw_picture_into_canvas.sky index 6b8024d9ba13b9ca7f471a6a99618dd8aff30c37..baf041d1d2b6ab1f1cfaf69cf6a5b3df8344d9fc 100644 --- a/examples/raw/draw_picture_into_canvas.sky +++ b/examples/raw/draw_picture_into_canvas.sky @@ -15,7 +15,7 @@ void main() { Picture stamp = stampRecorder.endRecording(); PictureRecorder recorder = new PictureRecorder(width, height); - Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0); recorder.drawCircle(50.0, 50.0, 50.0, paint); recorder.translate(10.0, 10.0); recorder.drawPicture(stamp); diff --git a/examples/raw/hello_world.dart b/examples/raw/hello_world.dart index 7e8e342bf2bf3a10ca759cd97ca33803e01e400f..d6685036095ffeeb5f2c5c730929ea7ca2eb82b0 100644 --- a/examples/raw/hello_world.dart +++ b/examples/raw/hello_world.dart @@ -12,7 +12,7 @@ Picture draw(int a, int r, int g, int b) { PictureRecorder recorder = new PictureRecorder(width, height); double radius = min(width, height) * 0.45; - Paint paint = new Paint()..color = Color.fromARGB(a, r, g, b); + Paint paint = new Paint()..color = new Color.fromARGB(a, r, g, b); recorder.drawCircle(width / 2, height / 2, radius, paint); return recorder.endRecording(); } diff --git a/examples/raw/paint_element_into_displaylist.sky b/examples/raw/paint_element_into_displaylist.sky index 1196436fb5c200880a76d957c67a48ad63e38463..31a1962d5370c5a759b2ec869d83e37e78491b62 100644 --- a/examples/raw/paint_element_into_displaylist.sky +++ b/examples/raw/paint_element_into_displaylist.sky @@ -11,7 +11,7 @@ void main() { double width = window.innerWidth.toDouble(); double height = window.innerHeight.toDouble(); PictureRecorder recorder = new PictureRecorder(width, height); - Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0); recorder.drawCircle(50.0, 50.0, 50.0, paint); recorder.translate(10.0, 10.0); root.paint(recorder); diff --git a/examples/raw/spinning_arabic.dart b/examples/raw/spinning_arabic.dart index 29f2bfcb62d634b48261334f50b6be4a47d5e719..846aa2a4cb62d7e7295f4498105c7dd820ebc663 100644 --- a/examples/raw/spinning_arabic.dart +++ b/examples/raw/spinning_arabic.dart @@ -16,7 +16,7 @@ void beginFrame(double timeStamp) { canvas.translate(view.width / 2.0, view.height / 2.0); canvas.rotate(math.PI * delta / 1800); canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0), - new Paint()..color = Color.fromARGB(255, 0, 255, 0)); + new Paint()..color = const Color.fromARGB(255, 0, 255, 0)); double sin = math.sin(delta / 200); layoutRoot.maxWidth = 150.0 + (50 * sin); diff --git a/examples/raw/spinning_image.dart b/examples/raw/spinning_image.dart index 87ca8be6141b2023027b0ff91a3d328a6b27bbb3..1a6a8932ade3b67cb5c1f5ff1e85b58998c7265f 100644 --- a/examples/raw/spinning_image.dart +++ b/examples/raw/spinning_image.dart @@ -19,7 +19,7 @@ void beginFrame(double timeStamp) { canvas.translate(view.width / 2.0, view.height / 2.0); canvas.rotate(math.PI * delta / 1800); canvas.scale(0.2, 0.2); - Paint paint = new Paint()..color = Color.fromARGB(255, 0, 255, 0); + Paint paint = new Paint()..color = const Color.fromARGB(255, 0, 255, 0); if (image != null) canvas.drawImage(image, -image.width / 2.0, -image.height / 2.0, paint); view.picture = canvas.endRecording(); diff --git a/examples/raw/spinning_square.dart b/examples/raw/spinning_square.dart index 5613248e4bdc26a5bfe7c90abe8313801e3760cd..24c3191f51f57ef787b45d0a20604368b4a03cc2 100644 --- a/examples/raw/spinning_square.dart +++ b/examples/raw/spinning_square.dart @@ -16,7 +16,7 @@ void beginFrame(double timeStamp) { canvas.translate(view.width / 2.0, view.height / 2.0); canvas.rotate(math.PI * delta / 1800); canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0), - new Paint()..color = Color.fromARGB(255, 0, 255, 0)); + new Paint()..color = const Color.fromARGB(255, 0, 255, 0)); view.picture = canvas.endRecording(); view.scheduleFrame(); tracing.end('beginFrame');