Thanks for the help;the key was, I think, (as usual??). Reading the .h files instead of relying on manuals, which are great but never
have everything. Btw. ‘Mighty Quinn ‘. Is a fun song I had forgotten about ! Great name!
‘Here is the answer i was looking for ...not the colors I asked 4 but representative.
NSSize isize = {400.0 , 400.0};
NSRect nrect = {0.0,0.0,isize.width, isize.height};
NSImage *image = [[NSImage alloc] initWithSize: isize];
[image lockFocus];
float x_plot= 200, y_plot= 25;
float diameter1 = 20;
NSBezierPath * path3;
path3=[NSBezierPath bezierPathWithRect:nrect];
[NSColor.yellowColor set];
[path3 fill];
[NSColor.blueColor set];
NSBezierPath * path2; // = [[NSBezierPath alloc] init] ; //rect: nrect];
path2=[NSBezierPath bezierPathWithOvalInRect:nrect];
[[NSColor blueColor] set];
[path2 fill];
NSRect myRect1 = NSMakeRect(x_plot, y_plot, diameter1, diameter1);
NSBezierPath *path1;
path1 = [NSBezierPath bezierPathWithOvalInRect:myRect1];
[[NSColor blackColor] set];
[path1 fill];
[image unlockFocus];
NSData *imageData = [image TIFFRepresentation];
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData];
NSNumber *compressionFactor = [NSNumber numberWithFloat:0.9];
NSDictionary *imageProps = [NSDictionary dictionaryWithObject:compressionFactor
forKey:NSImageCompressionFactor];
imageData = [imageRep representationUsingType:NSBitmapImageFileTypeJPEGproperties:imageProps];
[imageData writeToFile:@"/Users/aaaaa/abc4defg.jpg" atomically:YES];