New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Contrast Tool

The FlatColorPicker provides a Color Contrast Tool. It offers the capability for checking the color contrast ratio between two colors.

Color contrast between text and background is important on web pages. It affects some people’s ability to perceive the required information. The tool follows the WCAG recommendations for web accessibility.

According to the WCAG standard, there are two levels of contrast ratio:

  • AA (minimum contrast)—The level AA requires a contrast ratio of at least 4.5:1 for normal text.
  • AAA (enhanced contrast)—The level AAA requires a contrast ratio of at least 7:1 for normal text.

The example below demonstrates how to enable the contrast tool in the ColorPicker:

@(Html.Kendo().FlatColorPicker()
     .Name("foreground-picker")
     .Opacity(true)
     .Value("#d13838ff")
     .ContrastTool(c=>c.BackgroundColor("#ffffff"))
     .Events(ev => ev.Change("foregroundSelect"))
)

See Also

In this article