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

Improve accuracy of delta_h for small differences #501

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

kimikage
Copy link
Collaborator

This avoids the loss of significance when the difference in hue is small. (cf. #477 (comment))
This results in a slowdown of delta_h, but it is negligible compared to the total cost of DE_2000.

This is one of the preparations for PR #494.

julia> a = Lab(40, 4, 80); b = Lab(50, 5, 101);

julia> Colors.delta_h(a, b)
-0.043853227f0 # master
-0.04444444f0  # this PR

julia> Colors.delta_h(Lab{BigFloat}(a), Lab{BigFloat}(b))
-0.04444444308963756431578907136117476345617361364807484182394389220997687609203497

@codecov
Copy link

codecov bot commented Jul 19, 2021

Codecov Report

Merging #501 (0e7099b) into master (219f387) will decrease coverage by 0.03%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
- Coverage   93.64%   93.60%   -0.04%     
==========================================
  Files           9        9              
  Lines        1101     1111      +10     
==========================================
+ Hits         1031     1040       +9     
- Misses         70       71       +1     
Impacted Files Coverage Δ
src/utilities.jl 98.64% <92.85%> (-0.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 219f387...0e7099b. Read the comment docs.

This avoids the loss of significance when the difference in hue is small.
This results in a slowdown of `delta_h`,
but it is negligible compared to the total cost of `DE_2000`.
@kimikage kimikage merged commit f38f27c into JuliaGraphics:master Jul 22, 2021
@kimikage kimikage deleted the delta_h_accuracy branch July 22, 2021 02:02
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 this pull request may close these issues.

1 participant