inGamut - multiple declarations

Function inGamut

Reports whether an encoded sRGB value is directly representable in sRGB.

bool inGamut(T)(
  SRgb!T color
) pure nothrow @nogc @safe;

All three components must be finite and from 0 through 1 inclusive; no tolerance is applied.

Parameters

NameDescription
color Encoded sRGB value to test.

Returns

true exactly when all components are finite and in [0, 1].

Example

assert(SRgbd(0.1, 0.5, 1.0).inGamut);
assert(!SRgbd(-0.1, 0.5, 1.0).inGamut);

Function inGamut

Reports whether a linear-light sRGB value is directly representable in sRGB.

bool inGamut(T)(
  LinearSRgb!T color
) pure nothrow @nogc @safe;

All three components must be finite and from 0 through 1 inclusive; no tolerance is applied.

Parameters

NameDescription
color Linear-light sRGB value to test.

Returns

true exactly when all components are finite and in [0, 1].

Example

assert(LinearSRgbd(0.1, 0.5, 1.0).inGamut);
assert(!LinearSRgbd(0.1, 1.1, 0.5).inGamut);