Skip to content

Commit af4cd1e

Browse files
committed
.NET: Update MaterialColorUtilities to v0.1.0
1 parent 8cce0e6 commit af4cd1e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

material-color-utility-bin

1.87 KB
Binary file not shown.

material-color-utility/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,18 @@ public static int GetColor(string? path, int altColor, string? hexColor)
8080

8181
byte[] brgb = { Convert.ToByte(r), Convert.ToByte(g), Convert.ToByte(b) };
8282

83-
uint a = ColorUtils.IntFromRgb(brgb);
83+
uint a = IntFromRgb(brgb);
8484

8585
seedColor = (int)a;
8686
bestColors.Add("0", hexColor);
8787
}
8888
return seedColor;
8989
}
90+
public static uint IntFromRgb(byte[] rgb) =>
91+
0xFF000000 |
92+
((uint)rgb[0] & 255) << 16 |
93+
((uint)rgb[1] & 255) << 8 |
94+
(uint)rgb[2] & 255;
9095

9196
// Main Method
9297
static void Main(string[] args)

material-color-utility/material-color-utility.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="MaterialColorUtilities" Version="0.0.7" />
16+
<PackageReference Include="MaterialColorUtilities" Version="0.1.0" />
1717
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1818
<PackageReference Include="SkiaSharp" Version="2.80.3" />
1919
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.3" />

0 commit comments

Comments
 (0)