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

Side by Side Diff: samples/logo/logo.dart

Issue 10964030: A variety of cleanups to bring our samples up-to-date. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | samples/markdown/block_parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #import('dart:html'); 5 import 'dart:html';
6 #import('dart:math', prefix: 'Math'); 6 import 'dart:math' as Math;
7 7
8 class Color { 8 class Color {
9 int hue; 9 int hue;
10 double saturation; 10 double saturation;
11 double lightness; 11 double lightness;
12 12
13 Color(int this.hue, double this.saturation, double this.lightness); 13 Color(int this.hue, double this.saturation, double this.lightness);
14 14
15 factory Color.rgb(double red, double green, double blue) { 15 factory Color.rgb(double red, double green, double blue) {
16 final r = red; 16 final r = red;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 id="path2906" 165 id="path2906"
166 style="fill: #0082c4" /> 166 style="fill: #0082c4" />
167 <path 167 <path
168 d="m 273.04948,79.876866 c 0.072,0.02 0.148,0.044 0.22,0.064 l -0.004,-0.02 c -0.076,-0.02 -0.144,-0.024 -0.216,-0.044 z m 38.66001,20.576004 c -8.792,-8.8 60004 -24.37601,-16.912004 -38.44001,-20.512004 l 67.62801,191.727994 -21.24,47. 93601 -0.02,0.008 51.928,-16.592 0.1,-142.368 -59.956,-60.2 z" 168 d="m 273.04948,79.876866 c 0.072,0.02 0.148,0.044 0.22,0.064 l -0.004,-0.02 c -0.076,-0.02 -0.144,-0.024 -0.216,-0.044 z m 38.66001,20.576004 c -8.792,-8.8 60004 -24.37601,-16.912004 -38.44001,-20.512004 l 67.62801,191.727994 -21.24,47. 93601 -0.02,0.008 51.928,-16.592 0.1,-142.368 -59.956,-60.2 z"
169 id="path2908" 169 id="path2908"
170 style="fill: #008bc9" /> 170 style="fill: #008bc9" />
171 <path 171 <path
172 d="M 263.78548,53.048866 220.45349,10.028873 c -10.02,-9.92799955 -23.664,- 13.0239996 -30.26,-6.8439996 L 77.677489,77.672866 l 174.239991,-0.036 8.64,0.30 8 c 3.9,0.124 8.228,0.832 12.708,1.98 l -9.48,-26.876 z m -186.111991,24.62" 172 d="M 263.78548,53.048866 220.45349,10.028873 c -10.02,-9.92799955 -23.664,- 13.0239996 -30.26,-6.8439996 L 77.677489,77.672866 l 174.239991,-0.036 8.64,0.30 8 c 3.9,0.124 8.228,0.832 12.708,1.98 l -9.48,-26.876 z m -186.111991,24.62"
173 id="path2910" 173 id="path2910"
174 style="fill: #75ccc3" /> 174 style="fill: #75ccc3" />
175 </svg> 175 </svg>"""); // TOOD(dgrove) - add newline back when issue 3846 fixed.
176 """);
177 176
178 query("#icon").elements.add(logo); 177 query("#icon").elements.add(logo);
179 logo.queryAll("path").forEach((p) { 178 logo.queryAll("path").forEach((p) {
180 defaultColors[p.id] = new Color.hex(p.style.getPropertyValue('fill')); 179 defaultColors[p.id] = new Color.hex(p.style.getPropertyValue('fill'));
181 }); 180 });
182 181
183 hue = document.query("input[name=hue]"); 182 hue = document.query("input[name=hue]");
184 hue.on.change.add(onSliderChange); 183 hue.on.change.add(onSliderChange);
185 saturation = document.query("input[name=saturation]"); 184 saturation = document.query("input[name=saturation]");
186 saturation.on.change.add(onSliderChange); 185 saturation.on.change.add(onSliderChange);
187 lightness = document.query("input[name=lightness]"); 186 lightness = document.query("input[name=lightness]");
188 lightness.on.change.add(onSliderChange); 187 lightness.on.change.add(onSliderChange);
189 188
190 document.query("input[name=invert]").on.change.add((Event e) { 189 document.query("input[name=invert]").on.change.add((Event e) {
191 InputElement invert = e.target; 190 InputElement invert = e.target;
192 if (invert.checked) { 191 if (invert.checked) {
193 logo.classes = ['inverse']; 192 logo.classes = ['inverse'];
194 } else { 193 } else {
195 logo.classes = []; 194 logo.classes = [];
196 } 195 }
197 }); 196 });
198 } 197 }
OLDNEW
« no previous file with comments | « no previous file | samples/markdown/block_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698