Skip to content

Commit

Permalink
Adds DebuggerDisplay for GradientColor
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed Feb 24, 2023
1 parent 9414b94 commit 82e4b3c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Kook.Net.Core/Entities/Roles/GradientColor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System.Diagnostics;

namespace Kook;

/// <summary>
/// Represents a gradient color.
/// </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct GradientColor
{
public GradientColor(Color left, Color right)
Expand All @@ -23,4 +26,6 @@ public GradientColor(Color left, Color right)

public static implicit operator (Color Left, Color Right)(GradientColor gradient) => (gradient.Left, gradient.Right);
public static implicit operator GradientColor((Color Left, Color Right) gradient) => new(gradient.Left, gradient.Right);

private string DebuggerDisplay => $"{Left} -> {Right}";
}

0 comments on commit 82e4b3c

Please sign in to comment.