Function parseSRgb8Hex

Parses #RRGGBB and returns a typed public failure when parsing fails.

error_d.Result!(color.storage.SRgb8,color.storage.ColorParseError) parseSRgb8Hex(
  scope const(char)[] text
) pure nothrow @nogc @safe;

Example

SRgb8 value = SRgb8.init;

assert(tryParseSRgb8Hex(
    "#12AbF0",
    value
));

assert(value == SRgb8(
    0x12,
    0xAB,
    0xF0
));

const hex = value.toHex();
assert(hex[] == "#12abf0");