Function deltaEOK

Measures the perceptual distance between two Oklab colors.

T deltaEOK(T)(
  Oklab!T lhs,
  Oklab!T rhs
) pure nothrow @nogc @safe;

Use this to compare colors that are already expressed in Oklab. A result of zero means identical Oklab coordinates; larger values mean greater distance. Finite extended coordinates are accepted. The operation performs no hidden conversion, clipping, gamut mapping, alpha resolution, or just-noticeable difference classification.

NaN component differences produce NaN; otherwise any infinite component difference produces positive infinity.

Parameters

NameDescription
lhs First Oklab color.
rhs Second Oklab color.

Returns

The three-dimensional Euclidean distance in Oklab.

Standards

DeltaEOK follows the Euclidean Oklab definition described by W3C CSS Color Module Level 4.

Example

const origin = Oklabd(0, 0, 0);
const sample = Oklabd(3, 4, 12);

assert(origin.deltaEOK(sample) == 13);