mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 14:39:27 +01:00
add mixbox for csharp
This commit is contained in:
16
csharp/examples/HelloMixbox.cs
Normal file
16
csharp/examples/HelloMixbox.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Drawing;
|
||||
using Scrtwpns.Mixbox;
|
||||
|
||||
public class HelloMixbox
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Color color1 = Color.FromArgb(0, 33, 133); // blue
|
||||
Color color2 = Color.FromArgb(252, 211, 0); // yellow
|
||||
float t = 0.5f; // mixing ratio
|
||||
|
||||
Color colorMix = Color.FromArgb(Mixbox.Lerp(color1.ToArgb(), color2.ToArgb(), t));
|
||||
|
||||
System.Console.WriteLine(colorMix);
|
||||
}
|
||||
}
|
||||
12
csharp/examples/HelloMixbox.csproj
Normal file
12
csharp/examples/HelloMixbox.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mixbox" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user