add mixbox for csharp

This commit is contained in:
Ondrej Jamriska
2022-09-21 05:06:50 +02:00
parent 5e658f3c4e
commit b91fbb0e0b
5 changed files with 788 additions and 0 deletions

View 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);
}
}

View 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>