ColorUtilities.CompareContrastWithBlackAndWhite(Color) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Calculates the contrast ratio of the specified color against both black and white and returns which one has better contrast ratio.
public static Microsoft.VisualStudio.PlatformUI.ContrastComparisonResult CompareContrastWithBlackAndWhite (System.Windows.Media.Color color);
static member CompareContrastWithBlackAndWhite : System.Windows.Media.Color -> Microsoft.VisualStudio.PlatformUI.ContrastComparisonResult
Public Function CompareContrastWithBlackAndWhite (color As Color) As ContrastComparisonResult
Parameters
- color
- Color
A color which is assumed to be opaque.
Returns
Which of black or white has highest contrast ratio, or if they are equal.