public static ColorXYZ ToXYZ(ColorXYZFull xyz) { var x = (int)Math.Round(Clamp(xyz.X) * ColorXYZ.MaxValue); var y = (int)Math.Round(Clamp(xyz.Y) * ColorXYZ.MaxValue); var z = (int)Math.Round(Clamp(xyz.Z) * ColorXYZ.MaxValue); return new ColorXYZ(x, y, z); }
public static ColorRGBFull ToRGB(ColorXYZFull xyz) { return Multiply(XYZToRGB, xyz.X, xyz.Y, xyz.Z); }
public static ColorxyYFull ToxyY(ColorXYZFull xyz) { double sum = xyz.X + xyz.Y + xyz.Z; if (Math.Abs(sum) < Epsilon) { return new ColorxyYFull(1 / 3.0, 1 / 3.0, 0); } double x = xyz.X / sum; double y = xyz.Y / sum; return new ColorxyYFull(x, y, xyz.Y); }
public static ColorXYZFull Clamp(ColorXYZFull xyz) { return xyz; }