Open leonluc-dev opened 4 years ago
Update on Windows version:
After some extra testing I can confirm Visual Studio 2019 (16.3) on Windows has similar issues as the Mac edition.
The asset editor on the Windows edition of Visual Studio interprets floating point color values correctly, but integer or hex values are interpreted as a floating point value of 1.0 (leading to hex/integer based colors being rendered as white colors in the asset editor). While the values are interpreted incorrectly, no exceptions occur on opening the hex color sets like on Visual Studio for Mac, though.
Note: A seemingly related issue on Visual Studio for Windows that doesn't occur on the Mac edition is a localization related bug. If the development system formatting region is set to a region where commas are used for decimal notation, floating point values bug out in the same way hex values and integer values do. (Possibly due to Visual Studio interpreting the decimal period as the thousand separator, therefore interpreting the values as integers).
The reverse is also true in such localization scenarios. Any color set edited with the VS2019 asset editor will be generated using a comma as the decimal separator:
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "0,19607",
"green" : "0,19607",
"blue" : "0,8039",
"alpha" : "1,000"
}
}
The iOS runtime doesn't seem to be able to handle this, causing these color sets to render as a fully black color at runtime.
Thanks for the report. As this is primarily an IDE issue, I'll be creating a bug on their side to look at. You should see responses here hopefully.
If this is closed without a note, please @ me and I'll look into it.
I am currently having an issue with the handling of color asset values in Visual Studio For Mac. XCode can currently generate color assets in three different syntax: (Examples for a limegreen color #32CD32) Floating point:
Integer:
Hex:
The XCode designer and iOS runtime can handle all three kinds of syntax fine, but the Visual Studio for Mac asset editor seems to be unable to properly open any asset catalog containing anything other than floating point syntax.
Steps to Reproduce
Expected Behavior
Visual Studio shows the colors as expected, no matter if they are in floating point, integer or hex syntax.
Actual Behavior
Only the floating point syntax is rendered properly in the Visual Studio asset editor.
The integer syntax seems to be interpreted incorrectly, leading to unexpected colors (bright pink in the case of the limegreen color used in the examples above)
An asset catalog containing any color set with hex values downright won't open. In such cases an exception is written to the Visual Studio logs (as shown in the Logs paragraph below)
NOTE: While the editor won't open asset catalogs containing hex or integer color sets properly, the Xamarin iOS interface designer, compiler and the iOS runtime still process these color sets as intended.
Environment
Logs
Example Project (If Possible)
ColorTestApp.zip