This is a C# implementation of HSLuv rev.4 for Unity 2021.3+.
Note that there's an official repository of generic C# implementation. https://github.com/hsluv/hsluv-csharp
- Add "Mathematics" package to your project.
- Put
Assets/Hsluv/Runtime/Hsluv.csinto your project.
It contains the following standard HSLuv functions.
namespace Hsluv {
public static class Hsluv {
public static float3 HsluvToRgb(float3 v);
public static float3 RgbToHsluv(float3 v);
public static float3 HpluvToRgb(float3 v);
public static float3 RgbToHpluv(float3 v);
public static Vector3 HsluvToRgb(Vector3 v);
public static Vector3 RgbToHsluv(Vector3 v);
public static Vector3 HpluvToRgb(Vector3 v);
public static Vector3 RgbToHpluv(Vector3 v);
}
}See Assets/Hsluv/Samples~/ for details of other utility functions.