From a976aba582aa9526a8367736437e683145697b2f Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Mon, 13 Feb 2017 19:10:18 -0500 Subject: [PATCH] Fix 0.6 typealias depwarn --- REQUIRE | 2 +- src/Colors.jl | 10 +++++----- src/algorithms.jl | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/REQUIRE b/REQUIRE index f966419c..afe52c33 100644 --- a/REQUIRE +++ b/REQUIRE @@ -2,4 +2,4 @@ julia 0.5 ColorTypes 0.3.0 FixedPointNumbers 0.3.0 Reexport -Compat 0.17.0 +Compat 0.18.0 diff --git a/src/Colors.jl b/src/Colors.jl index 4474fa93..c9e5761a 100644 --- a/src/Colors.jl +++ b/src/Colors.jl @@ -7,12 +7,12 @@ using FixedPointNumbers, ColorTypes, Reexport, Compat # deprecated exports export U8, U16 -typealias AbstractGray{T} Color{T,1} +@compat AbstractGray{T} = Color{T,1} using ColorTypes: TransparentGray -typealias AbstractAGray{C<:AbstractGray,T} AlphaColor{C,T,2} -typealias AbstractGrayA{C<:AbstractGray,T} ColorAlpha{C,T,2} -typealias Color3{T} Color{T,3} -typealias Transparent4{C<:Color3,T} TransparentColor{C,T,4} +@compat AbstractAGray{C<:AbstractGray,T} = AlphaColor{C,T,2} +@compat AbstractGrayA{C<:AbstractGray,T} = ColorAlpha{C,T,2} +@compat Color3{T} = Color{T,3} +@compat Transparent4{C<:Color3,T} = TransparentColor{C,T,4} import Base: ==, +, -, *, / import Base: convert, eltype, hex, isless, linspace, show, typemin, typemax diff --git a/src/algorithms.jl b/src/algorithms.jl index 86b2e54d..5507b1db 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -1,6 +1,6 @@ # Arithmetic #XYZ and LMS are linear vector spaces -typealias Linear3 Union{XYZ, LMS} +const Linear3 = Union{XYZ, LMS} +{C<:Linear3}(a::C, b::C) = C(comp1(a)+comp1(b), comp2(a)+comp2(b), comp3(a)+comp3(b)) -{C<:Linear3}(a::C, b::C) = C(comp1(a)-comp1(b), comp2(a)-comp2(b), comp3(a)-comp3(b)) -(a::Linear3) = typeof(a)(-comp1(a), -comp2(a), -comp3(a))