Table of Contents

Method FindOrAddColor

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

FindOrAddColor(Color?, string?)

Finds an existing color that matches the specified value or adds a new color if no match is found.

public virtual Color? FindOrAddColor(Color? value, string? title = null)

Parameters

value Color

The color to search for or add. Cannot be null.

title string

An optional title associated with the color. If provided, it may be used to label the color.

Returns

Color

The matching or newly added Color instance, or null if the operation fails.

Remarks

This method attempts to locate a color that matches the specified value. If no match is found, a new color is added to the collection.