WcagHelpers.GetContrastRatio method

Version 1.0.2
.NET Framework 4.7
Namespace Skybrud.Colors.Wcag
Assembly Skybrud.Colors.dll

GetContrastRatio(RgbColor, RgbColor)

Static

Calculates the constrast ratio of to given colors as specified by the WCAG 2.0 specification.

public static double GetContrastRatio(RgbColor color1, RgbColor color2)

Parameters

color1 RgbColor

The first color.

color2 RgbColor

The second color.

Returns

The constrast ratio.