From 9ff39eb6039cc306a8d96e66a52e9dcb2590d08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 27 Nov 2012 17:35:03 -0800 Subject: [PATCH] Define Color.random() similar to Point.random(). --- src/color/Color.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/color/Color.js b/src/color/Color.js index 89632a22..74a21236 100644 --- a/src/color/Color.js +++ b/src/color/Color.js @@ -334,6 +334,10 @@ var Color = this.Color = Base.extend(new function() { }, src); } return this.base(src); + }, + + random: function() { + return new RgbColor(Math.random(), Math.random(), Math.random()); } } };