ColorHelper.cs 628 B

123456789101112131415161718192021
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Veldrid.Common.Tools
  8. {
  9. internal static class ColorHelper
  10. {
  11. public static System.Numerics.Vector4 ColorConverToVect4(this Color color)
  12. {
  13. return new System.Numerics.Vector4(color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f);
  14. }
  15. public static RgbaFloat ColorConverToRGBA(this Color color)
  16. {
  17. return new RgbaFloat(color.R / 255f, color.G / 255f, color.B / 255f, color.A / 255f);
  18. }
  19. }
  20. }