add set color alpha shortcuts

This commit is contained in:
DCFApixels 2025-04-08 18:25:15 +08:00
parent 809a04c8fb
commit fe5142dbdc

View File

@ -198,10 +198,18 @@ namespace DCFApixels
{ {
return new DrawHandler(GetCurrentDefaultDuration(), color); return new DrawHandler(GetCurrentDefaultDuration(), color);
} }
public static DrawHandler Draw((Color color, float alphaMultiplier) color)
{
return new DrawHandler(GetCurrentDefaultDuration(), color.ToColor());
}
public static DrawHandler Draw(float duration, Color color) public static DrawHandler Draw(float duration, Color color)
{ {
return new DrawHandler(duration, color); return new DrawHandler(duration, color);
} }
public static DrawHandler Draw(float duration, (Color color, float alphaMultiplier) color)
{
return new DrawHandler(duration, color.ToColor());
}
//public static DrawHandler Draw(float r, float g, float b, float a = 1f) //TODO //public static DrawHandler Draw(float r, float g, float b, float a = 1f) //TODO
public readonly partial struct DrawHandler public readonly partial struct DrawHandler
@ -221,8 +229,10 @@ namespace DCFApixels
//ContextController = GetCurrenRenderContextController(); //ContextController = GetCurrenRenderContextController();
} }
[IN(LINE)] public DrawHandler Setup(float duration, Color color) => new DrawHandler(duration, color); [IN(LINE)] public DrawHandler Setup(float duration, Color color) => new DrawHandler(duration, color);
[IN(LINE)] public DrawHandler Setup(float duration, (Color color, float alphaMultiplier) color) => new DrawHandler(duration, color.ToColor());
[IN(LINE)] public DrawHandler Setup(float duration) => new DrawHandler(duration, Color); [IN(LINE)] public DrawHandler Setup(float duration) => new DrawHandler(duration, Color);
[IN(LINE)] public DrawHandler Setup(Color color) => new DrawHandler(Duration, color); [IN(LINE)] public DrawHandler Setup(Color color) => new DrawHandler(Duration, color);
[IN(LINE)] public DrawHandler Setup((Color color, float alphaMultiplier) color) => new DrawHandler(Duration, color.ToColor());
//[IN(LINE)] //[IN(LINE)]
//private DrawHandler(float time, Color color, RenderContextController contextController) //private DrawHandler(float time, Color color, RenderContextController contextController)
//{ //{