Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export of CIE2006_2_CMF and CIE2006_10_CMF #375

Closed
kimikage opened this issue Dec 14, 2019 · 0 comments · Fixed by #376
Closed

Export of CIE2006_2_CMF and CIE2006_10_CMF #375

kimikage opened this issue Dec 14, 2019 · 0 comments · Fixed by #376

Comments

@kimikage
Copy link
Collaborator

CIE2006 XYZ CMFs for 2° and 10° observers were added in 4ef1406, but they have not been exported.

colormatch, CIE1931_CMF, CIE1964_CMF, CIE1931J_CMF, CIE1931JV_CMF

Moreover, there is a typo.

Colors.jl/src/colormatch.jl

Lines 1178 to 1182 in c9f4349

function colormatch(::Type{CIE2006_2_CMF}, wavelen::Real)
return interpolate_table(cie2006_2deg_xyz_cmf_table, 380.0, 1.0, wavelen)
end
const cie2006_2deg_xyz_cmftable=

So, we should add the following minimal tests:

@testset "Colormatch" begin
    @test colormatch(500) === colormatch(CIE1931_CMF, 500)

    cmfs = (CIE1931_CMF, CIE1964_CMF, CIE1931J_CMF, CIE1931JV_CMF, CIE2006_2_CMF, CIE2006_10_CMF)
    @testset "$cmf" for cmf in cmfs
        @test colormatch(cmf, 350.0) === XYZ(0.0, 0.0, 0.0)
        @test colormatch(cmf, 850.0) === XYZ(0.0, 0.0, 0.0)
        xyz450 = colormatch(cmf, 450.0)
        @test xyz450.y < xyz450.x < xyz450.z
        xyz550 = colormatch(cmf, 550.0)
        @test xyz550.z < xyz550.x < xyz550.y
        xyz600 = colormatch(cmf, 600.0)
        @test xyz600.z < xyz600.y < xyz600.x
        xyz551 = colormatch(cmf, 551.0)
        @test colormatch(cmf, 550.5)  (xyz550 + colormatch(cmf, 551)) / 2
    end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant