Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public LinkLabel() : base()
[SRDescription(nameof(SR.LinkLabelActiveLinkColorDescr))]
public Color ActiveLinkColor
{
get => _activeLinkColor.IsEmpty ? IEActiveLinkColor : _activeLinkColor;
get => !_activeLinkColor.IsEmpty
? _activeLinkColor
: Application.IsDarkModeEnabled
? LinkUtilities.DarkModeActiveLinkColor
: IEActiveLinkColor;
set
{
if (_activeLinkColor != value)
Expand Down Expand Up @@ -234,9 +238,13 @@ public LinkBehavior LinkBehavior
[SRDescription(nameof(SR.LinkLabelLinkColorDescr))]
public Color LinkColor
{
get => _linkColor.IsEmpty
? SystemInformation.HighContrast ? SystemColors.HotTrack : IELinkColor
: _linkColor;
get => !_linkColor.IsEmpty
? _linkColor
: SystemInformation.HighContrast
? SystemColors.HotTrack
: Application.IsDarkModeEnabled
? LinkUtilities.DarkModeLinkColor
: IELinkColor;
set
{
if (_linkColor != value)
Expand Down Expand Up @@ -345,9 +353,13 @@ public override string Text
[SRDescription(nameof(SR.LinkLabelVisitedLinkColorDescr))]
public Color VisitedLinkColor
{
get => _visitedLinkColor.IsEmpty
? SystemInformation.HighContrast ? LinkUtilities.GetVisitedLinkColor() : IEVisitedLinkColor
: _visitedLinkColor;
get => !_visitedLinkColor.IsEmpty
? _visitedLinkColor
: SystemInformation.HighContrast
? LinkUtilities.GetVisitedLinkColor()
: Application.IsDarkModeEnabled
? LinkUtilities.DarkModeVisitedLinkColor
: IEVisitedLinkColor;
set
{
if (_visitedLinkColor != value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ public static Color IEVisitedLinkColor
}
}

/// <summary>
/// Gets a light blue link color suitable for dark mode backgrounds.
/// </summary>
public static Color DarkModeLinkColor => Color.FromArgb(102, 178, 255);

/// <summary>
/// Gets a light red active link color suitable for dark mode backgrounds.
/// </summary>
public static Color DarkModeActiveLinkColor => Color.FromArgb(255, 128, 128);

/// <summary>
/// Gets a light purple visited link color suitable for dark mode backgrounds.
/// </summary>
public static Color DarkModeVisitedLinkColor => Color.FromArgb(200, 162, 255);

/// Produces a color for visited links using SystemColors
public static Color GetVisitedLinkColor()
{
Expand Down