Merge pull request #17 from TheBrokenRail/add-more-nscolor

Add ``+[NSColor colorWithSRGBRed]`` And ``+[NSColor colorWithRed]``
This commit is contained in:
Andrew Hyatt 2021-06-05 17:30:07 -04:00 committed by GitHub
commit 455320e98a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -562,6 +562,29 @@ NSString *const NSSystemColorsDidChangeNotification = @"NSSystemColorsDidChangeN
spaceName: NSDeviceRGBColorSpace];
}
+ (NSColor *) colorWithRed: (CGFloat) red
green: (CGFloat) green
blue: (CGFloat) blue
alpha: (CGFloat) alpha
{
return [NSColor colorWithDeviceRed: red
green: green
blue: blue
alpha: alpha];
}
+ (NSColor *) colorWithSRGBRed: (CGFloat) red
green: (CGFloat) green
blue: (CGFloat) blue
alpha: (CGFloat) alpha
{
return [NSColor_CGColor colorWithRed: red
green: green
blue: blue
alpha: alpha
spaceName: NSNamedColorSpace];
}
+ (NSColor *) colorWithDeviceHue: (CGFloat) hue
saturation: (CGFloat) saturation
brightness: (CGFloat) brightness

View File

@ -97,6 +97,14 @@ APPKIT_EXPORT NSString *const NSSystemColorsDidChangeNotification;
green: (CGFloat) green
blue: (CGFloat) blue
alpha: (CGFloat) alpha;
+ (NSColor *) colorWithRed: (CGFloat) red
green: (CGFloat) green
blue: (CGFloat) blue
alpha: (CGFloat) alpha;
+ (NSColor *) colorWithSRGBRed: (CGFloat) red
green: (CGFloat) green
blue: (CGFloat) blue
alpha: (CGFloat) alpha;
+ (NSColor *) colorWithDeviceHue: (CGFloat) hue
saturation: (CGFloat) saturation
brightness: (CGFloat) brightness