Skip to content

Commit

Permalink
Fixed codegen for colors in states
Browse files Browse the repository at this point in the history
fixes #1342
  • Loading branch information
vchelaru committed Feb 1, 2024
1 parent 1dcf236 commit 4f5c541
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,19 @@ private object Convert(object whatToConvert, CustomVariable variable)
{
var valueAsString = whatToConvert?.ToString();

if(TypeManager.TryConvertStringValue(variable.Type, valueAsString, out object convertedValue))
// If this is a color like "White", we want to keep that named color
if(variable.Type == "Color")
{
return convertedValue;
// keep this as-is.
}
else
{
if(TypeManager.TryConvertStringValue(variable.Type, valueAsString, out object convertedValue))
{
return convertedValue;
}
}

return whatToConvert;
}
catch
Expand Down

0 comments on commit 4f5c541

Please sign in to comment.