From cfa21b0c9686d25951fee27103dad4e00c7ea609 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Sat, 23 May 2009 17:28:21 -0700 Subject: [PATCH] Add a randomColor method. Useful for debugging. --- AppKit/CPColor.j | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index 9bd934b90..d4188c92e 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -623,6 +623,15 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image @end +@implementation CPColor (Debugging) + ++ (CPColor)randomColor +{ + return [CPColor colorWithRed:RAND() green:RAND() blue:RAND() alpha:1.0]; +} + +@end + var CPColorComponentsKey = @"CPColorComponentsKey", CPColorPatternImageKey = @"CPColorPatternImageKey";