New to KendoReactStart a free 30-day trial

resolveElementColor
Premium

Updated on Apr 15, 2026

Resolves the color of the specified CSS property of an element to an RGB color string.

Supports standard CSS color formats and relative color functions (e.g., oklch()) by leveraging the browser's CSS parsing capabilities.

Parameters

element

Element

The DOM element whose color is to be resolved.
colorProp

string

The CSS property name (e.g., 'color', 'backgroundColor') whose color is to be resolved.

Returns

string

The resolved hex color string (e.g., '#ff0000' or '#ff0000aa').
Not finding the help you need?
Contact Support