Skip to content

[4.0] [AppKit overlay] Use NSColor(red:green:blue:alpha:) for color literals. #11168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

DougGregor
Copy link
Member

Explanation: When mapping color literals to NSColor, use the NSColor(red:green:blue:alpha:) initializer, which supports extended sRGB.
Scope: Extremely narrow: only affects color literals whose components are negative or > 1.0.
Radar: rdar://problem/33500905
Risk: Effectively zero; we're just switching to a more-widely-applicable NSColor initializer.
Reviewed By: @jrose-apple
Testing: Compiler regression tests.

This initializer, which is the same on iOS, allows negative values and
values > 1.0 to support the extended sRGB color space.

Fixes rdar://problem/33500905.

(cherry picked from commit 8b3889a)
@DougGregor DougGregor added this to the Swift 4.0 milestone Jul 25, 2017
@DougGregor
Copy link
Member Author

@swift-ci please test

@ematejska ematejska merged commit 9049eb1 into swiftlang:swift-4.0-branch Jul 25, 2017
@DougGregor DougGregor deleted the nscolor-literal-extended-srgb-4.0 branch July 25, 2017 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants