 <p>What TBlue said: The components of an <code>NSColor</code> go from 0.0 to 1.0, not 0 to 255. (Also, the upper bound of <code>arc4random_uniform()</code> is what the result will be <em>less</em> than, not what the max value of the result can be.)</p> <pre><code>- (IBAction)randomColor:(id)sender { int size = 256; int R = arc4random_uniform(size); int G = arc4random_uniform(size); int B = arc4random_uniform(size); NSColor *newcolor = [NSColor colorWithCalibratedRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:1.0]; [self.colorwell setColor:newcolor]; } </code></pre>