Using F# in C# WinUI 3 Apps #4 (WIP) - FireCubeStudios/Mica-Studio GitHub Wiki

upcoming blog post about using F# in Mica Studio

C# ` int HexToColor(string hexString) { // Remove # if it exists if (hexString.IndexOf('#') != -1) hexString = hexString.Replace("#", "");

byte r = byte.Parse(hexString.Substring(0, 2), NumberStyles.AllowHexSpecifier);
byte g = byte.Parse(hexString.Substring(2, 2), NumberStyles.AllowHexSpecifier);
byte b = byte.Parse(hexString.Substring(4, 2), NumberStyles.AllowHexSpecifier);

// Combine into an integer in RGB format
int color = r | (g << 8) | (b << 16);

return color;

} `