Skip to content
Snippets Groups Projects
Commit c8ace05f authored by George Nachman's avatar George Nachman
Browse files

Fix a crash in ColorPicker where blackColor was placed in _colors but we asked for -redComponent.

parent 2ae081e1
No related branches found
No related tags found
No related merge requests found
No preview for this file type
Loading
Loading
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15B42</string>
<string>15C50</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@
 
NSArray *centerColumn = _colors[_colors.count / 2];
NSColor *centerColor = centerColumn[centerColumn.count / 2];
centerColor = [centerColor colorUsingColorSpace:[NSColorSpace sRGBColorSpace]];
NSString *description = [NSString stringWithFormat:@"#%02x%02x%02x R:%d G:%d B:%d",
(int)(centerColor.redComponent * 255),
(int)(centerColor.greenComponent * 255),
Loading
Loading
Loading
Loading
@@ -157,18 +157,19 @@ const NSTimeInterval kUpdateInterval = 1.0 / 60.0;
NSMutableArray *outerArray = [NSMutableArray array];
const NSInteger radius = 9;
NSBitmapImageRep *screenshot = [self currentScreenScreenshot];
NSColor *blackColor = [NSColor colorWithRed:0 green:0 blue:0 alpha:1];
for (NSInteger x = point.x - radius; x <= point.x + radius; x++) {
NSMutableArray *innerArray = [NSMutableArray array];
for (NSInteger y = point.y - radius; y <= point.y + radius; y++) {
NSColor *color = [NSColor blackColor];
NSColor *color = blackColor;
@try {
color = [screenshot colorAtX:x y:y];
if (!color) {
color = [NSColor blackColor];
color = blackColor;
}
}
@catch (NSException *exception) {
color = [NSColor blackColor];
color = blackColor;
}
[innerArray addObject:color];
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment