From dd2c15ac83f779203e2612500a1d4b4d27622869 Mon Sep 17 00:00:00 2001 From: sasensi Date: Wed, 21 Nov 2018 11:18:02 +0100 Subject: [PATCH] Add documentation for Color.random() --- src/style/Color.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/style/Color.js b/src/style/Color.js index e219c6e3..dcfb079e 100644 --- a/src/style/Color.js +++ b/src/style/Color.js @@ -1183,6 +1183,17 @@ var Color = Base.extend(new function() { // Export for backward compatibility code below. _types: types, + /** + * Creates a random color. + * + * @return {Color} the randomly created color + * @static + * + * @example {@paperscript} + * var circle = new Path.Circle(view.center, 50); + * // Set a random color as circle fill color. + * circle.fillColor = Color.random(); + */ random: function() { var random = Math.random; return new Color(random(), random(), random());