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.ShellAssembly: ShellBrowser (in ShellBrowser.dll) Version: 7.3
Syntaxpublic static bool IsDark(
this Color pColor
)
<ExtensionAttribute>
Public Shared Function IsDark (
pColor As Color
) As Boolean
public:
[ExtensionAttribute]
static bool IsDark(
Color pColor
)
[<ExtensionAttribute>]
static member IsDark :
pColor : Color -> bool Parameters
- pColor Color
- The color to act on.
Return Value
Booleantrue 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).
RemarksSBNET-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