Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Side by Side Diff: sky/examples/raw/painting.sky

Issue 1169863002: Sky: Added radial gradients. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/painting/Shader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <sky> 1 <sky>
2 <style> 2 <style>
3 div { 3 div {
4 height: 200px; 4 height: 200px;
5 background-color: lightblue; 5 background-color: lightblue;
6 } 6 }
7 </style> 7 </style>
8 <div id="canvas" /> 8 <div id="canvas" />
9 <script> 9 <script>
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 layerPaint.color = const Color.fromARGB(128, 255, 255, 0); 57 layerPaint.color = const Color.fromARGB(128, 255, 255, 0);
58 layerPaint.setColorFilter( 58 layerPaint.setColorFilter(
59 new ColorFilter(const Color.fromARGB(128, 0, 0, 255), 59 new ColorFilter(const Color.fromARGB(128, 0, 0, 255),
60 TransferMode.srcInMode)); 60 TransferMode.srcInMode));
61 layerPaint.setMaskFilter( 61 layerPaint.setMaskFilter(
62 new MaskFilter.Blur(BlurStyle.normal, 3.0, highQuality: true)); 62 new MaskFilter.Blur(BlurStyle.normal, 3.0, highQuality: true));
63 }) 63 })
64 ..addLayerOnTop( 64 ..addLayerOnTop(
65 new DrawLooperLayerInfo() 65 new DrawLooperLayerInfo()
66 ..setOffset(const Point(75.0, 75.0)) 66 ..setOffset(const Point(75.0, 75.0))
67 ..setColorMode(TransferMode.srcMode), 67 ..setColorMode(TransferMode.srcMode)
68 ..setPaintBits(-1),
68 (Paint layerPaint) { 69 (Paint layerPaint) {
69 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); 70 Gradient redYellow = new Gradient.Radial(
71 new Point(0.0, 0.0), radius,
72 [const Color(0xFFFFFF00), const Color(0xFFFF0000)],
73 null);
74 layerPaint.setShader(redYellow);
70 }) 75 })
71 ..addLayerOnTop( 76 ..addLayerOnTop(
72 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)), 77 new DrawLooperLayerInfo()..setOffset(const Point(225.0, 75.0)),
73 (Paint layerPaint) { 78 (Paint layerPaint) {
74 // Since this layer uses a DST color mode, this has no effect. 79 // Since this layer uses a DST color mode, this has no effect.
75 layerPaint.color = const Color.fromARGB(128, 255, 0, 0); 80 layerPaint.color = const Color.fromARGB(128, 255, 0, 0);
76 }); 81 });
77 paint.setDrawLooper(builder.build()); 82 paint.setDrawLooper(builder.build());
78 context.drawCircle(0.0, 0.0, radius, paint); 83 context.drawCircle(0.0, 0.0, radius, paint);
79 84
80 context.commit(); 85 context.commit();
81 }); 86 });
82 } 87 }
83 </script> 88 </script>
84 </sky> 89 </sky>
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Shader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698