Add documentation for Color.random()

This commit is contained in:
sasensi 2018-11-21 11:18:02 +01:00
parent 27d9903c74
commit dd2c15ac83

View file

@ -1183,6 +1183,17 @@ var Color = Base.extend(new function() {
// Export for backward compatibility code below. // Export for backward compatibility code below.
_types: types, _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() { random: function() {
var random = Math.random; var random = Math.random;
return new Color(random(), random(), random()); return new Color(random(), random(), random());