Use Float32 to calculate colordiff for low precision colors#504
Merged
kimikage merged 1 commit intoJuliaGraphics:masterfrom Jul 30, 2021
Merged
Use Float32 to calculate colordiff for low precision colors#504kimikage merged 1 commit intoJuliaGraphics:masterfrom
Float32 to calculate colordiff for low precision colors#504kimikage merged 1 commit intoJuliaGraphics:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #504 +/- ##
==========================================
+ Coverage 93.80% 93.84% +0.04%
==========================================
Files 9 9
Lines 1146 1154 +8
==========================================
+ Hits 1075 1083 +8
Misses 71 71
Continue to review full report at Codecov.
|
cf83495 to
b6a67dc
Compare
For consistency with `DE_2000`, this allows `Float32` to be used for other metrics.
b6a67dc to
9ed09ac
Compare
Collaborator
Author
Examplesjulia> function cdiff(m)
a = Colors.JULIA_LOGO_COLORS.red
b = Colors.JULIA_LOGO_COLORS.purple
println(colordiff(a, b, metric=m))
println(colordiff(RGB{Float64}(a), RGB{Float64}(b), metric=m))
println(colordiff(RGB{BigFloat}(a), RGB{BigFloat}(b), metric=m))
end
cdiff (generic function with 1 method)
julia> cdiff(DE_2000())
33.82887
33.82887329869433
33.82887329869434796475792923435851027620015476174136875625922539498207369411706
julia> cdiff(DE_94())
38.23486
38.234862143090865
38.23486214309088608963095792665674301916407422865080768162621819010507168360492
julia> cdiff(DE_JPC79())
37.878086
37.87808541971468
37.87808541971468968166730168312403080137191745434699713648683643401155205874664
julia> cdiff(DE_CMC())
52.563896
52.563899827254474
52.5638998272545176069372623733566704452279622154186758390851358812518998154462
julia> cdiff(DE_BFD())
49.900528
49.90052646306692
49.90052646306697049716708771910579177559075682142050054874112972427357928337113 |
Float32 to calculate colordiff for low precision colorsFloat32 to calculate colordiff for low precision colors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to PR #494.
For consistency with
DE_2000, this allowsFloat32to be used for other metrics.