Skip to content

Commit

Permalink
Fix deprecation warnings for 0.4 Dict change
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Oct 8, 2014
1 parent e3ed5f6 commit 9367c4e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions src/Color.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ if !isdefined(:rad2deg)
const deg2rad = degrees2radians
end

# Dict compatibility
if VERSION < v"0.4-"
macro Dict(pairs...)
Expr(:dict, pairs...)
end
else
macro Dict(pairs...)
Expr(:call, :Dict, pairs...)
end
end


# The core; every other include will need these type definitions
include("colorspaces.jl")

Expand Down
8 changes: 4 additions & 4 deletions src/maps_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Colormap parameters

const colormaps_sequential = {
const colormaps_sequential = @Dict(
#single hue
#name hue w d c s b wcolor dcolor
"blues" => (255, 0.3, 0.25, 0.88, 0.6, 0.75, RGB(1,1,0), RGB(0,0,1)),
Expand All @@ -12,10 +12,10 @@ const colormaps_sequential = {
"oranges" => (20, 0.5, 0.4, 0.83, 0.95, 0.85, RGB(1,1,0), RGB(1,0,0)),
"purples" => (265, 0.15, 0.2, 0.88, 0.5, 0.7, RGB(1,0,1), RGB(1,0,0)),
"reds" => (12, 0.15, 0.25, 0.8, 0.85, 0.6, RGB(1,1,0), RGB(0.3,0.1,0.1))
}
)

const colormaps_diverging = {
const colormaps_diverging = @Dict(
#name h1 h2 w d1 d2 c s b wcolor dcolor dcolor2
"rdbu" => (12, 255, 0.2, 0.6, 0.0, 0.85, 0.6, 0.65, RGB(1,1,0), RGB(1,0,0), RGB(0,0,1))
}
)

4 changes: 2 additions & 2 deletions src/names_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is the union of every color defined in X11 and in SVG, prefering the SVG
# definition when they clash.

const color_names = {
const color_names = @Dict(
"aliceblue" => (240, 248, 255),
"antiquewhite" => (250, 235, 215),
"antiquewhite1" => (255, 239, 219),
Expand Down Expand Up @@ -664,5 +664,5 @@ const color_names = {
"yellow3" => (205, 205, 0),
"yellow4" => (139, 139, 0),
"yellowgreen" => (154, 205, 50)
}
)

0 comments on commit 9367c4e

Please sign in to comment.