| <sky> |
| <style> |
| div { |
| height: 200px; |
| background-color: lightblue; |
| } |
| </style> |
| <div id="canvas" /> |
| <script> |
| import 'dart:math' as math; |
| import 'dart:sky'; |
| |
| void main() { |
| var element = document.getElementById('canvas'); |
| element.requestPaint((PaintingContext context) { |
| Paint paint = new Paint(); |
| 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(); |
| }); |
| } |
| </script> |
| </sky> |