Index: sky/engine/core/painting/Gradient.dart |
diff --git a/sky/engine/core/painting/Gradient.dart b/sky/engine/core/painting/Gradient.dart |
index bb1b027601827e9fa1aeaba5d1e0a69fa16377ac..eaed84c857d651f7b4e10b864954bbbca36b8e57 100644 |
--- a/sky/engine/core/painting/Gradient.dart |
+++ b/sky/engine/core/painting/Gradient.dart |
@@ -4,19 +4,26 @@ |
part of dart.sky; |
+/// Defines what happens at the edge of the gradient. |
enum TileMode { |
+ /// Edge is clamped to the final color. |
clamp, |
+ /// Edge is repeated from first color to last. |
repeated, |
+ /// Edge is mirrored from last color to first. |
mirror |
} |
-// Extends the generated _Gradient interface via the PrivateDart attribute. |
+/// Extends the generated _Gradient interface via the PrivateDart attribute. |
class Gradient extends _Gradient { |
+ /// Creates a linear gradient from [endPoint[0]] to [endPoint[1]]. If |
+ /// [colorStops] is provided, [colorStops[i]] is a number from 0 to 1 that |
+ /// specifies where [color[i]] begins in the gradient. |
// TODO(mpcomplete): Maybe pass a list of (color, colorStop) pairs instead? |
- Gradient.Linear(List<Point> endPoints, |
+ Gradient.linear(List<Point> endPoints, |
List<Color> colors, |
- List<double> colorStops, |
- [TileMode tileMode = TileMode.clamp]) |
+ [List<double> colorStops = null, |
+ TileMode tileMode = TileMode.clamp]) |
: super() { |
if (endPoints == null || endPoints.length != 2) |
throw new ArgumentError("Expected exactly 2 [endPoints]."); |
@@ -24,11 +31,15 @@ class Gradient extends _Gradient { |
this._initLinear(endPoints, colors, colorStops, tileMode); |
} |
- Gradient.Radial(Point center, |
+ /// Creates a radial gradient centered at [center] that ends at [radius] |
+ /// distance from the center. If [colorStops] is provided, [colorStops[i]] is |
+ /// a number from 0 to 1 that specifies where [color[i]] begins in the |
+ /// gradient. |
+ Gradient.radial(Point center, |
double radius, |
List<Color> colors, |
- List<double> colorStops, |
- [TileMode tileMode = TileMode.clamp]) |
+ [List<double> colorStops = null, |
+ TileMode tileMode = TileMode.clamp]) |
: super() { |
validateColorStops(colors, colorStops); |
this._initRadial(center, radius, colors, colorStops, tileMode); |