mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add documentation for Color.random()
This commit is contained in:
parent
27d9903c74
commit
dd2c15ac83
1 changed files with 11 additions and 0 deletions
|
@ -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());
|
||||||
|
|
Loading…
Reference in a new issue