Table of Contents

Method CoerceColor

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

CoerceColor(Color?)

Attempts to resolve the specified color value to a corresponding item, returning a coerced color if available.

public virtual Color? CoerceColor(Color? value)

Parameters

value Color

The color value to coerce. If the value does not correspond to an item, the original value is used.

Returns

Color

The coerced color value if a corresponding item is found; otherwise, the original value.

Remarks

This method searches for an item matching the provided color value. If no match is found, the input value is returned unchanged.