diff --git a/REQUIRE b/REQUIRE index 2034ee8..a1bcf3f 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,6 +1,6 @@ julia 0.6 Colors 0.7.1 -ColorTypes 0.4 +ColorTypes 0.6.3 FixedPointNumbers 0.3.0 StatsBase 0.8.2 Compat 0.18.0 diff --git a/src/ColorVectorSpace.jl b/src/ColorVectorSpace.jl index 467f46b..ae5035d 100644 --- a/src/ColorVectorSpace.jl +++ b/src/ColorVectorSpace.jl @@ -264,14 +264,10 @@ norm(c::TransparentGray) = sqrt(abs2(c)) isless(g1::AbstractGray, g2::AbstractGray) = isless(gray(g1), gray(g2)) isless(c::AbstractGray, r::Real) = isless(gray(c), r) isless(r::Real, c::AbstractGray) = isless(r, gray(c)) -Base.isapprox(x::AbstractGray, y::AbstractGray; kwargs...) = isapprox(gray(x), gray(y); kwargs...) -Base.isapprox(x::TransparentGray, y::TransparentGray; kwargs...) = isapprox(gray(x), gray(y); kwargs...) && isapprox(alpha(x), alpha(y); kwargs...) -Base.isapprox(x::AbstractRGB, y::AbstractRGB; kwargs...) = isapprox(red(x), red(y); kwargs...) && isapprox(green(x), green(y); kwargs...) && isapprox(blue(x), blue(y); kwargs...) -Base.isapprox(x::TransparentRGB, y::TransparentRGB; kwargs...) = isapprox(alpha(x), alpha(y); kwargs...) && isapprox(red(x), red(y); kwargs...) && isapprox(green(x), green(y); kwargs...) && isapprox(blue(x), blue(y); kwargs...) function Base.isapprox{Cx<:MathTypes,Cy<:MathTypes}(x::AbstractArray{Cx}, y::AbstractArray{Cy}; - rtol::Real=Base.rtoldefault(eltype(Cx),eltype(Cy)), + rtol::Real=Base.rtoldefault(eltype(Cx),eltype(Cy),0), atol::Real=0, norm::Function=vecnorm) d = norm(x - y) diff --git a/test/runtests.jl b/test/runtests.jl index ce339d6..b35c8ff 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -112,7 +112,7 @@ end @test isapprox(a, a) @test real(Gray{Float32}) <: Real @test zero(ColorTypes.Gray) == 0 - @test one(ColorTypes.Gray) == 1 + @test oneunit(ColorTypes.Gray) == 1 a = Gray{N0f8}[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] @test StatsBase.histrange(a,10) == 0.1f0:0.1f0:1f0