Skip to content

Commit

Permalink
Merge pull request #274 from JuliaGraphics/yyc/0.6
Browse files Browse the repository at this point in the history
Fix 0.6 depwarns in src/
  • Loading branch information
timholy committed Feb 10, 2017
2 parents ea7aa16 + 5d52e66 commit a6ed074
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/colormaps.jl
Expand Up @@ -18,7 +18,7 @@ in the palette.
Args:
- `n`: Number of colors to generate.
- `seed`: Initial color(s) included in the palette. Default is `Array(RGB{N0f8},0)`.
- `seed`: Initial color(s) included in the palette. Default is `Vector{RGB{N0f8}}(0)`.
Keyword arguments:
Expand All @@ -42,21 +42,21 @@ function distinguishable_colors{T<:Color}(n::Integer,

# Candidate colors
N = length(lchoices)*length(cchoices)*length(hchoices)
candidate = Array(Lab{Float64}, N)
candidate = Vector{Lab{Float64}}(N)
j = 0
for h in hchoices, c in cchoices, l in lchoices
rgb = convert(RGB, LCHab(l, c, h))
candidate[j+=1] = convert(LCHab, rgb)
end

# Transformed colors
candidate_t = Array(Lab{Float64}, N)
candidate_t = Vector{Lab{Float64}}(N)
for i = 1:N
candidate_t[i] = transform(candidate[i])
end

# Start with the seed colors
colors = Array(T, n)
colors = Vector{T}(n)
copy!(colors, seed)

# Minimum distances of the current color to each previously selected color.
Expand All @@ -83,7 +83,7 @@ end


distinguishable_colors(n::Integer, seed::Color; kwargs...) = distinguishable_colors(n, [seed]; kwargs...)
distinguishable_colors(n::Integer; kwargs...) = distinguishable_colors(n, Array(RGB{N0f8},0); kwargs...)
distinguishable_colors(n::Integer; kwargs...) = distinguishable_colors(n, Vector{RGB{N0f8}}(0); kwargs...)

@deprecate distinguishable_colors(n::Integer,
transform::Function,
Expand Down

0 comments on commit a6ed074

Please sign in to comment.