More refactoring

This commit is contained in:
Alexey Golub
2020-04-24 14:18:41 +03:00
parent 9d0d7cd5dd
commit d03be8b1dd
43 changed files with 617 additions and 655 deletions

View File

@@ -4,12 +4,10 @@ namespace DiscordChatExporter.Domain.Internal
{
internal static class ColorExtensions
{
public static Color ResetAlpha(this Color color) => Color.FromArgb(1, color);
public static Color WithAlpha(this Color color, int alpha) => Color.FromArgb(alpha, color);
public static Color ResetAlpha(this Color color) => color.WithAlpha(255);
public static int ToRgb(this Color color) => color.ToArgb() & 0xffffff;
public static string ToHexString(this Color color) => $"#{color.ToRgb():x6}";
public static string ToRgbString(this Color color) => $"{color.R}, {color.G}, {color.B}";
}
}