| OLD | NEW |
| 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 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 6 $!MEMBERS | 6 $!MEMBERS |
| 7 | 7 |
| 8 /** |
| 9 * Sets the color used inside shapes. |
| 10 * [r], [g], [b] are 0-255, [a] is 0-1. |
| 11 */ |
| 8 void setFillColorRgb(int r, int g, int b, [num a = 1]) { | 12 void setFillColorRgb(int r, int g, int b, [num a = 1]) { |
| 9 this.fillStyle = 'rgba($r, $g, $b, $a)'; | 13 this.fillStyle = 'rgba($r, $g, $b, $a)'; |
| 10 } | 14 } |
| 11 | 15 |
| 16 /** |
| 17 * Sets the color used inside shapes. |
| 18 * [h] is in degrees, 0-360. |
| 19 * [s], [l] are in percent, 0-100. |
| 20 * [a] is 0-1. |
| 21 */ |
| 12 void setFillColorHsl(int h, num s, num l, [num a = 1]) { | 22 void setFillColorHsl(int h, num s, num l, [num a = 1]) { |
| 13 this.fillStyle = 'hsla($h, $s%, $l%, $a)'; | 23 this.fillStyle = 'hsla($h, $s%, $l%, $a)'; |
| 14 } | 24 } |
| 15 | 25 |
| 26 /** |
| 27 * Sets the color used for stroking shapes. |
| 28 * [r], [g], [b] are 0-255, [a] is 0-1. |
| 29 */ |
| 16 void setStrokeColorRgb(int r, int g, int b, [num a = 1]) { | 30 void setStrokeColorRgb(int r, int g, int b, [num a = 1]) { |
| 17 this.strokeStyle = 'rgba($r, $g, $b, $a)'; | 31 this.strokeStyle = 'rgba($r, $g, $b, $a)'; |
| 18 } | 32 } |
| 19 | 33 |
| 34 /** |
| 35 * Sets the color used for stroking shapes. |
| 36 * [h] is in degrees, 0-360. |
| 37 * [s], [l] are in percent, 0-100. |
| 38 * [a] is 0-1. |
| 39 */ |
| 20 void setStrokeColorHsl(int h, num s, num l, [num a = 1]) { | 40 void setStrokeColorHsl(int h, num s, num l, [num a = 1]) { |
| 21 this.strokeStyle = 'hsla($h, $s%, $l%, $a)'; | 41 this.strokeStyle = 'hsla($h, $s%, $l%, $a)'; |
| 22 } | 42 } |
| 23 } | 43 } |
| OLD | NEW |