Skip to content

Commit

Permalink
Use julia 0.4 compatible dict syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
c42f committed Apr 19, 2015
1 parent f42be31 commit 66b88de
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bindings/julia/Displaz.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module Displaz
using Compat

# Quick and nasty matlab-like plotting interface
export plot, clf, hold
Expand Down Expand Up @@ -68,14 +69,14 @@ end
# :marksize => (array_semantic,1),
# :markshape => (array_semantic,1)]

const color_names = ['r' => [1.0 0 0],
'g' => [0.0 0.8 0],
'b' => [0.0 0 0.8],
'c' => [0.0 1 1],
'm' => [1.0 0 1],
'y' => [1.0 1 0],
'k' => [0.0 0 0],
'w' => [1.0 1 1]]
const color_names = @compat Dict('r' => [1.0 0 0],
'g' => [0.0 0.8 0],
'b' => [0.0 0 0.8],
'c' => [0.0 1 1],
'm' => [1.0 0 1],
'y' => [1.0 1 0],
'k' => [0.0 0 0],
'w' => [1.0 1 1])

interpret_color(color) = color
interpret_color(s::String) = length(s) == 1 ? interpret_color(s[1]) : error("Unknown color abbreviation $s")
Expand Down

0 comments on commit 66b88de

Please sign in to comment.