How to use the colorio.illuminants function in colorio

To help you get started, we’ve selected a few colorio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / colorio / test / test_illuminants.py View on Github external
        (colorio.illuminants.f2(), [0.99146841, 1.0, 0.67318498], 1.0e-8),
    ],
)
def test_white_point(illuminant, ref, tol):
    values = colorio.illuminants.white_point(illuminant)
    ref = 100 * numpy.array(ref)
    assert numpy.all(abs(values - ref) < tol * abs(ref))
    return
github nschloe / colorio / test / test_illuminants.py View on Github external
        (colorio.illuminants.e(), [1.00015018, 1.0, 1.00066598], 1.0e-8),
        (colorio.illuminants.f2(), [0.99146841, 1.0, 0.67318498], 1.0e-8),
    ],
)
def test_white_point(illuminant, ref, tol):
    values = colorio.illuminants.white_point(illuminant)
    ref = 100 * numpy.array(ref)
    assert numpy.all(abs(values - ref) < tol * abs(ref))
    return
github nschloe / colorio / test / test_illuminants.py View on Github external
        (colorio.illuminants.d65(), [0.95048974, 1.0, 1.08892197], 1.0e-8),
        (colorio.illuminants.e(), [1.00015018, 1.0, 1.00066598], 1.0e-8),
        (colorio.illuminants.f2(), [0.99146841, 1.0, 0.67318498], 1.0e-8),
    ],
)
def test_white_point(illuminant, ref, tol):
    values = colorio.illuminants.white_point(illuminant)
    ref = 100 * numpy.array(ref)
    assert numpy.all(abs(values - ref) < tol * abs(ref))
    return
github nschloe / colorio / test / test_illuminants.py View on Github external
        (colorio.illuminants.a(5e-9), 5, [0.93048, 1.12821, 1.35769]),
        (colorio.illuminants.d50(), 3, [0.019, 2.051, 7.778]),
        (colorio.illuminants.d55(), 3, [0.024, 2.072, 11.224]),
        (colorio.illuminants.d65(), 4, [0.03410, 3.2945, 20.2360]),
        # 5.132 is different from the standard; 5.133 is listed there. This is a
        # false rounding.
        (colorio.illuminants.d75(), 3, [0.043, 5.132, 29.808]),
    ],
)
def test_values(illuminant, decimals, values):
    _, data = illuminant
    rdata = numpy.around(data, decimals=decimals)
    assert rdata[0] == values[0]
    assert rdata[1] == values[1]
    assert rdata[2] == values[2]
    return