Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow access to GetSoftenedColor for library users #34

Merged
merged 1 commit into from
Feb 27, 2024
Merged
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
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
Loading