Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ internal class ColorConverter : ISGTypeConverter

public string Convert(string value, BaseNode node, ITypeSymbol toType, SourceGenContext context, LocalVariable? parentVar = null)
{
value = value.Trim();
if (ColorUtils.TryParse(value, out float red, out float green, out float blue, out float alpha))
{
var colorType = context.Compilation.GetTypeByMetadataName("Microsoft.Maui.Graphics.Color")!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void Test()
x:Class="Test.TestPage">
<ContentPage.Resources>
<Style TargetType="Label" x:Key="style">
<Setter Property="TextColor" Value="Pink" />
<Setter Property="TextColor" Value="Pink " />
<Setter Property="IsVisible" Value="{OnPlatform Android=True, iOS=False}" />
</Style>
</ContentPage.Resources>
Expand Down Expand Up @@ -120,7 +120,7 @@ private partial void InitializeComponent()
setter.Property = ((global::Microsoft.Maui.Controls.IExtendedTypeConverter)new global::Microsoft.Maui.Controls.BindablePropertyConverter()).ConvertFromInvariantString("TextColor", xamlServiceProvider1) as global::Microsoft.Maui.Controls.BindableProperty;
#line default
#line 8 "{{testXamlFilePath}}"
setter.Value = "Pink";
setter.Value = "Pink ";
#line default
var setter2 = new global::Microsoft.Maui.Controls.Setter {Property = global::Microsoft.Maui.Controls.Label.TextColorProperty, Value = global::Microsoft.Maui.Graphics.Colors.Pink};
if (global::Microsoft.Maui.VisualDiagnostics.GetSourceInfo(setter2!) == null)
Expand Down
Loading