Is it possible for a user to highlight a color in OS X using Cocoa?

I want this color value to be used with Cocoa:

enter image description here

Thank.

+4
source share
2 answers

NSColor for users The highlight color will be the selectedControlColor control color

As far as I know, you first need to convert selectedControlColor to a known color space, since it is not based on NSNamedColorSpace.

NSNamedColorSpace =      . , .


, ( ) . , . , , , , , , .


 NSColor *aColor = [[NSColor selectedControlColor] colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
    if (aColor) {
        NSLog(@"   Red %f, Green %f, Blue %f,  Alpha %f,", aColor.redComponent,aColor.greenComponent,aColor.blueComponent,aColor.alphaComponent);
    }

.

, , , .

+7

NSColor .

,

NSColor , : . - selectedControlColor selectedTextBackgroundColor - , , .

+3

Source: https://habr.com/ru/post/1532419/


All Articles