Click or drag to resize

ExtensionMethodsIsDark Method

A Color extension method that determines whether the color is "dark", i.e. dark mode is effectively in effect for a control using this color as its background.

Namespace: Jam.Shell
Assembly: ShellBrowser (in ShellBrowser.dll) Version: 7.3
Syntax
public static bool IsDark(
	this Color pColor
)

Parameters

pColor  Color
The color to act on.

Return Value

Boolean
true if the color is dark; otherwise false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Color. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
SBNET-1897: Detecting that the effective background is dark via its brightness is more robust than comparing against Window, which is itself dark in dark mode.
See Also