XyzColor.random constructor
XyzColor.random({})
Generates a XyzColor at random.
minX
and maxX
constrain the generated x value.
minY
and maxY
constrain the generated y value.
minZ
and maxZ
constrain the generated z value.
All min and max values must be min <= max && max >= min
, must be
in the range of >= 0 && <= 100
, and must not be null
.
Implementation
factory XyzColor.random({
num minX = 0,
num maxX = 100,
num minY = 0,
num maxY = 100,
num minZ = 0,
num maxZ = 100,
int? seed,
}) {
assert(minX >= 0 && minX <= maxX);
assert(maxX >= minX && maxX <= 100);
assert(minY >= 0 && minY <= maxY);
assert(maxY >= minY && maxY <= 100);
assert(minZ >= 0 && minZ <= maxZ);
assert(maxZ >= minZ && maxZ <= 100);
return cm.XyzColor.random(
minX: minX,
maxX: maxX,
minY: minY,
maxY: maxY,
minZ: minZ,
maxZ: maxZ,
seed: seed,
).cast();
}