Skip to content

Commit

Permalink
fix: style + case diff between iOS and Mac API
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot authored and jeromelaban committed May 18, 2023
1 parent 91dc17e commit 53467fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Uno.UWP/UI/Color.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ public partial struct Color : IFormattable
public static implicit operator UIKit.UIColor(Color color) => UIKit.UIColor.FromRGBA(color.R, color.G, color.B, color.A);
public static implicit operator CGColor(Color color)
{
if (legacy) {
if (legacy)
{
return UIKit.UIColor.FromRgba(color.R, color.G, color.B, color.A).CGColor;
} else {
}
else
{
return CGColor.CreateSrgb(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/Uno.UWP/UI/Color.macOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ public partial struct Color : IFormattable
public static implicit operator AppKit.NSColor(Color color) => AppKit.NSColor.FromRgba(color.R, color.G, color.B, color.A);
public static implicit operator CGColor(Color color)
{
if (legacy) {
return AppKit.NSColor.FromRGBA(color.R, color.G, color.B, color.A).CGColor;
} else {
if (legacy)
{
return AppKit.NSColor.FromRgba(color.R, color.G, color.B, color.A).CGColor;
}
else
{
return CGColor.CreateSrgb(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
}
}
Expand Down

0 comments on commit 53467fc

Please sign in to comment.