ASP.NET Core ColorGradient Overview
The Telerik UI ColorGradient TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI ColorGradient widget.
The ColorGradient is a component that renders a gradient color palette. It has a hue and an alpha slider and provides an input that allows you to enter a color or copy the selected one.
Telerik UI for ASP.NET Core is a
professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
New to Telerik UI for ASP.NET Core?
Initializing the ColorGradient
The ColorGradient is usually used as a color editor. The following example demonstrates how to define the ColorGradient.
@(Html.Kendo().ColorGradient()
.Name("colorGradient") // The name of the ColorGradient is mandatory. It specifies the "id" attribute.
.Value("#ff0000")
)
<kendo-colorgradient name="colorgradient"
value="#ff0000">
</kendo-colorgradient>
Basic Configuration
The ColorGradient provides default configuration options such as input, format, opacity, and so on.
The following example shows a basic implementation of the control.
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.Input(true)
.Format(ColorGradientFormat.Hex)
.Opacity(true)
.Value("#f16e0aff")
)
<kendo-colorgradient name="colorgradient"
input="true"
format="ColorGradientFormat.Hex"
opacity="true"
value="#f16e0aff">
</kendo-colorgradient>
Functionality and Features
- Formats—The ColorGradient supports both RGB and HEX input formats.
- Contrast Tool—You can use the Color Contrast Tool that is built into the ColorGradient to check the color contrast ratio between two colors.
- Accessibility—The ColorGradient is accessible by screen readers and provides WAI-ARIA, Section 508, WCAG 2.2, and keyboard support.