Bug 34347 - iOS ToCGColor() extension method converts White to Transparent
Summary: iOS ToCGColor() extension method converts White to Transparent
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-28 12:13 UTC by aer127
Modified: 2015-09-30 15:22 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description aer127 2015-09-28 12:13:52 UTC
In Xamarin.Forms, there is an extension method to convert a Xamarin.Forms.Color to a CoreGraphics.CGColor. The name of this extension method is ToCGColor(). If the color (255,255,255,255) white is passed into this extension method, the extension method actually returns transparent instead of white. For instance,

Xamarin.Forms.Color color = new Xamarin.Forms.Color(255,255,255,255);
CoreGraphics.CGColor cgColor = color.ToCGColor();  <------ this returns a color with the alpha channel = 0

However, if you use the static Xamarin.Forms.Color.White property, the correct value is returned.

CoreGraphics.CGColor test = Xamarin.Forms.Color.White.ToCGColor(); <-----actually returns white, not transparent
Comment 1 Paul DiPietro [MSFT] 2015-09-30 12:56:28 UTC
Could you provide a reproduction example displaying the issue? At the moment I am not able to reproduce this issue using Forms 1.5.0.6447.
Comment 2 aer127 2015-09-30 15:22:33 UTC
I am closing this issue. After further testing, we determined the error was in our code.