[SR-7194] #colorLiteral producing unexpected results when explicitly written #49742
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
XCode Version 9.2 (9C40b)
Additional Detail from JIRA
md5: f68bab241c74e93a15f5560fb22a116c
Issue Description:
I wasn't sure whether to report this here or in the Bug Reporter, since #colorLiteral is part of the STL, but is implemented only for UIColor. If it has to go to Bug Reporter, please inform me.
Explicitly writing a color literal or pasting it with code
will produce a color with the following components:
So, for instance, this produces pure red:
This – pure magenta:
And this – pure white:
In other words, if any of the color components is > 0 and <= 1, the result will be a color with that component equal to 1.
The text was updated successfully, but these errors were encountered: