JuliaGraphics / ColorTypes.jl

Basic color definitions and traits
Other
77 stars 35 forks source link

Move `real(::Type{<:AbstractGray})` from ColorVectorSpace #248

Closed kimikage closed 3 years ago

kimikage commented 3 years ago

In practice, the method does not have much impact because of the fallback in Base. However, there are some differences as follows:

master w/o ColorVectorSpace

julia> real(Gray{Float32})
Float32

julia> real(Gray24)
ERROR: MethodError: no method matching zero(::Type{Gray24})

julia> real(Gray)
N0f8 (alias for Normed{UInt8, 8})

this PR (or w/ ColorVectorSpace)

julia> real(Gray{Float32})
Float32

julia> real(Gray24)
N0f8 (alias for Normed{UInt8, 8})

julia> real(Gray)
ERROR: MethodError: no method matching zero(::Type{Any})
codecov[bot] commented 3 years ago

Codecov Report

Merging #248 (d44fb14) into master (0c96dbe) will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   82.47%   82.49%   +0.02%     
==========================================
  Files           8        8              
  Lines         736      737       +1     
==========================================
+ Hits          607      608       +1     
  Misses        129      129              
Impacted Files Coverage Δ
src/ColorTypes.jl 100.00% <ø> (ø)
src/conversions.jl 86.81% <100.00%> (+0.14%) :arrow_up:

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 0c96dbe...d44fb14. Read the comment docs.