Table of Contents

Method TryParse

Namespace
DocWright.Core.Primitives
Assembly
DocWright.Core.dll

TryParse(string?, out ColorRgb)

Attempts to parse an ST_HexColor value. See Parse(string).

public static bool TryParse(string? text, out ColorRgb color)

Parameters

text string

The text to parse; may be null.

color ColorRgb

The parsed color on success; Black on failure.

Returns

bool

true if the text was a valid ST_HexColor value.

TryParse(ReadOnlySpan<char>, out ColorRgb)

Attempts to parse an ST_HexColor value from a character span. Allocation-free.

public static bool TryParse(ReadOnlySpan<char> text, out ColorRgb color)

Parameters

text ReadOnlySpan<char>

The text to parse.

color ColorRgb

The parsed color on success; Black on failure.

Returns

bool

true if the text was a valid ST_HexColor value.