Skip to content

Commit

Permalink
Moves TextColor to TextTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed Jan 19, 2023
1 parent 395fbec commit 7737439
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Kook;

/// <summary>
/// Represents text colors used in <see cref="Format.Colorize"/>.
/// Represents text themes used in <see cref="Format.Colorize"/>.
/// </summary>
public enum TextColor : ushort
public enum TextTheme : ushort
{
Primary,
Success,
Expand Down
6 changes: 3 additions & 3 deletions src/Kook.Net.Core/Format.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public static class Format
/// <summary> Returns a markdown-formatted string with strike-through formatting. </summary>
public static string Strikethrough(string text) => $"~~{text}~~";

/// <summary> Returns a markdown-formatted string colored with the specified <see cref="TextColor"/>. </summary>
/// <summary> Returns a markdown-formatted string colored with the specified <see cref="TextTheme"/>. </summary>
/// <remarks>
/// <note type="warning">
/// Colored text is only supported in cards.
/// </note>
/// </remarks>
public static string Colorize(string text, TextColor color) =>
$"(font){text}(font)[{color.ToString().ToLowerInvariant()}]";
public static string Colorize(string text, TextTheme theme) =>
$"(font){text}(font)[{theme.ToString().ToLowerInvariant()}]";

/// <summary> Returns a markdown-formatted URL. </summary>
public static string Url(string text, string url) => $"[{text}]({url})";
Expand Down

0 comments on commit 7737439

Please sign in to comment.