Unity-DebugX/Runtime/Internal/ColorExtensions.cs

19 lines
424 B
C#
Raw Normal View History

2025-02-22 17:25:54 +08:00
using UnityEngine;
namespace DCFApixels.DebugXCore.Internal
{
internal static class ColorExtensions
{
public static Color SetAlpha(this Color self, float v)
{
self.a *= v;
return self;
}
2025-04-08 18:25:45 +08:00
public static Color ToColor(ref this (Color color, float alpha) self)
{
self.color.a *= self.alpha;
return self.color;
}
2025-02-22 17:25:54 +08:00
}
}