<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks Dennis. Now I get it!<div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 11, 2016, at 9:57 AM, Dennis Weissmann &lt;<a href="mailto:dennis@dennisweissmann.me" class="">dennis@dennisweissmann.me</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Huh! There’s a new overload for that initializer:<div class=""><br class=""></div><div class=""><span id="cid:7001B124-1CA5-4DD4-8A7D-3CB91776FAE9@Speedport_W_724V_01011603_00_008">&lt;Screen Shot 2016-05-11 at 3.52.34 PM.png&gt;</span></div><div class=""><br class=""></div><div class="">The one that takes CGFloats is the one that was there before, but the one taking Floats is new!</div><div class=""><br class=""></div><div class="">You can work around like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> color = UIColor(red: CGFloat(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.892</span><span style="font-variant-ligatures: no-common-ligatures" class="">), green: CGFloat(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.609</span><span style="font-variant-ligatures: no-common-ligatures" class="">), blue: CGFloat(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.048</span><span style="font-variant-ligatures: no-common-ligatures" class="">),&nbsp; alpha: CGFloat(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1.000</span><span style="font-variant-ligatures: no-common-ligatures" class="">))</span></div></div><div class="">or</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> color = </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">UIColor</span><span style="font-variant-ligatures: no-common-ligatures" class="">(red: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.892</span><span style="font-variant-ligatures: no-common-ligatures" class="">), green: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.609</span><span style="font-variant-ligatures: no-common-ligatures" class="">), blue: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.048</span><span style="font-variant-ligatures: no-common-ligatures" class="">),&nbsp; alpha: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Float</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1.000</span><span style="font-variant-ligatures: no-common-ligatures" class="">))</span></div><div class=""><br class=""></div><div class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">- Dennis</div></div>

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 11, 2016, at 3:46 PM, Charles Lane via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">The following code worked fine in previous development snapshots but fails in the May 9, 2016 snapshot:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>let color = UIColor(red: 0.892, green: 0.609, blue: 0.048, &nbsp;alpha: 1.000)<br class=""><br class="">Does anyone know whether this is a bug or if the syntax changed? (Yes, I imported UIKit). Xcode gives an error of ‘Ambiguous use of init(red:green:blue:alpha:)’<br class=""><br class=""><br class="">_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>