diff --git a/Project.toml b/Project.toml index d724b25..94b363c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PlotThemes" uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" -version = "0.4.0" +version = "1.0.0" [deps] PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043" @@ -8,8 +8,9 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -PlotUtils = "≥ 0.5.0" -julia = "≥ 0.7.0" +PlotUtils = "0.5, 0.6" +Requires = "0.5" +julia = "0.7, 1" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/README.md b/README.md index c66dd0e..2ff7a4e 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ Themes can be previewed using `Plots.showtheme(thm::Symbol)`: ## Contributing A theme specifies default values for different Plots [attributes](http://docs.juliaplots.org/attributes/). -At the moment these are typically colors, palettes and gradients, but any Plots attribute can be controlled by a theme in general. +At the moment these are typically colors, palettes and colorgradients, but any Plots attribute can be controlled by a theme in general. PRs for new themes very welcome! Adding a new theme (e.g. `mytheme`) is as easy as adding a new file (mytheme.jl) that contains at least the following line: ```julia _themes[:mytheme] = PlotTheme(; kwargs...) ``` -The keyword arguments can be any collection of Plots attributes. +The keyword arguments can be any collection of Plots attributes plus a colorgradient keyword argument. diff --git a/src/PlotThemes.jl b/src/PlotThemes.jl index a6dfc31..23ac5d1 100644 --- a/src/PlotThemes.jl +++ b/src/PlotThemes.jl @@ -36,8 +36,8 @@ const _themes = Dict{Symbol, PlotTheme}(:default => PlotTheme()) gradient_name(s::Symbol) = s == :default ? :inferno : Symbol(s, "_grad") function add_theme(s::Symbol, thm::PlotTheme) - if haskey(thm.defaults, :gradient) - PlotUtils.register_gradient_colors(gradient_name(s), thm.defaults[:gradient], :misc) + if haskey(thm.defaults, :colorgradient) + PlotUtils.register_gradient_colors(gradient_name(s), thm.defaults[:colorgradient], :misc) end _themes[s] = thm end diff --git a/src/dark.jl b/src/dark.jl index 55caef6..1e39e67 100644 --- a/src/dark.jl +++ b/src/dark.jl @@ -15,5 +15,5 @@ _themes[:dark] = PlotTheme( fgguide = colorant"#FFFFFF", fglegend = colorant"#FFFFFF", palette = expand_palette(dark_bg, dark_palette; lchoices = [57], cchoices = [100]), - gradient = cgrad(:fire).colors + colorgradient = cgrad(:fire).colors ) diff --git a/src/juno.jl b/src/juno.jl index 09577bf..1184f08 100644 --- a/src/juno.jl +++ b/src/juno.jl @@ -16,5 +16,5 @@ _themes[:juno] = PlotTheme( fgguide = colorant"#9EB1BE", fglegend = colorant"#9EB1BE", palette = expand_palette(juno_bg, juno_palette; lchoices = [57], cchoices = [100]), - gradient = cgrad(:fire).colors + colorgradient = cgrad(:fire).colors ) diff --git a/src/juno_smart.jl b/src/juno_smart.jl index 1a664d1..7d1253c 100644 --- a/src/juno_smart.jl +++ b/src/juno_smart.jl @@ -22,6 +22,6 @@ if Juno.isactive() fgguide = colors["variable"], fglegend = colors["variable"], palette = expand_palette(colors["background"], juno_palette; lchoices = [57], cchoices = [100]), - gradient = grad + colorgradient = grad ) end diff --git a/src/lime.jl b/src/lime.jl index 92bf9ef..420fc49 100644 --- a/src/lime.jl +++ b/src/lime.jl @@ -16,5 +16,5 @@ _themes[:lime] = PlotTheme( fgguide = lime_palette[2], fglegend = lime_palette[2], palette = expand_palette(black, lime_palette[1:4]), - gradient = cgrad(:viridis).colors + colorgradient = cgrad(:viridis).colors ) diff --git a/src/orange.jl b/src/orange.jl index 7bf880c..45c894e 100644 --- a/src/orange.jl +++ b/src/orange.jl @@ -17,5 +17,5 @@ _themes[:orange] = PlotTheme( fgguide = orange_palette[2], fglegend = orange_palette[2], palette = expand_palette(black, orange_palette[1:4]), - gradient = cgrad(:viridis).colors + colorgradient = cgrad(:viridis).colors ) diff --git a/src/sand.jl b/src/sand.jl index 83fbc4b..a66a5f4 100644 --- a/src/sand.jl +++ b/src/sand.jl @@ -18,5 +18,5 @@ _themes[:sand] = PlotTheme( fgguide = colorant"#725B61", fglegend = colorant"#725B61", palette = expand_palette(sand_bg, sand_palette), - gradient = cgrad(:dense).colors + colorgradient = cgrad(:dense).colors ) diff --git a/src/solarized.jl b/src/solarized.jl index ceed67b..6488573 100644 --- a/src/solarized.jl +++ b/src/solarized.jl @@ -28,7 +28,7 @@ _themes[:solarized] = PlotTheme( fgguide = _solarized_colors[:base01], fglegend = _solarized_colors[:base01], palette = expand_palette(_solarized_colors[:base03], [_solarized_colors[c] for c in _solarized_palette]), - gradient = cgrad(:YlOrRd_r).colors + colorgradient = cgrad(:YlOrRd_r).colors ) _themes[:solarized_light] = PlotTheme( @@ -39,5 +39,5 @@ _themes[:solarized_light] = PlotTheme( fgguide = _solarized_colors[:base1], fglegend = _solarized_colors[:base1], palette = expand_palette(_solarized_colors[:base3], [_solarized_colors[c] for c in _solarized_palette]), - gradient = cgrad(:YlOrRd_r).colors + colorgradient = cgrad(:YlOrRd_r).colors ) diff --git a/src/wong.jl b/src/wong.jl index 033ce31..aa7862a 100644 --- a/src/wong.jl +++ b/src/wong.jl @@ -12,10 +12,10 @@ const wong_palette = [ _themes[:wong] = PlotTheme( palette = expand_palette(colorant"white", wong_palette; lchoices = [57], cchoices = [100]), - gradient = cgrad(:viridis).colors, + colorgradient = cgrad(:viridis).colors, ) _themes[:wong2] = PlotTheme( palette = expand_palette(colorant"white", [RGB(0,0,0); wong_palette]; lchoices = [57], cchoices = [100]), - gradient = cgrad(:viridis).colors, + colorgradient = cgrad(:viridis).colors, )