Function SRgb8.toSRgb

Converts packed encoded-sRGB bytes to normalized computational sRGB.

SRgb!T toSRgb(T)() const pure nothrow @nogc @safe
if (is(T == float) || is(T == double));

Each byte is divided by 255 in the requested scalar type. No transfer function, clipping, gamut mapping, or other color-space conversion occurs.

Returns

An SRgb!T value whose components are in inclusive [0, 1].

Example

enum packed = SRgb8(255, 128, 0);
enum normalized = packed.toSRgb!double();

static assert(normalized.r == 1.0);
static assert(normalized.g == 128.0 / 255.0);
static assert(normalized.b == 0.0);