Skip to content

Commit

Permalink
allow access to GetSoftenedColor for library users (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolframhaussig authored Feb 27, 2024
1 parent 8c429af commit 9de3f8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions WinFormsThemes/WinFormsThemes/Themes/AbstractTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,13 @@ public void UseLogger(ILoggerFactory loggerFactory)
/// <returns>Softened color</returns>
/// <remarks>
/// This should primarily thought of as helper function to use the same colors and modify them
/// dependent on dark/light theme.
/// dependent on dark/light theme.
/// Although this could be done as a static method, I find it more easily understandable for a user to have
/// it as an instance method
/// </remarks>
protected static Color GetSoftenedColor(Color baseColor, bool switchDarkAndLight = false)
#pragma warning disable CA1822 // Member als statisch markieren
public Color GetSoftenedColor(Color baseColor, bool switchDarkAndLight = false)
#pragma warning restore CA1822 // Member als statisch markieren
{
// HSL lightness value 0 = black, 1 = white
if (baseColor.GetBrightness() < 0.5 || switchDarkAndLight)
Expand Down

0 comments on commit 9de3f8a

Please sign in to comment.