From 0f1e8fa4d6c464d3f9eefeb0620522ce7fc669e0 Mon Sep 17 00:00:00 2001 From: pacman <83340886+BaerLKR@users.noreply.github.com> Date: Mon, 27 May 2024 11:20:28 +0200 Subject: [PATCH] added "rose_pine" and "rose_pine_dawn" (#72) * rose-pine * Update README.md with images * added it to the readme list --- README.md | 8 ++++++++ src/PlotThemes.jl | 6 +++++- src/rose_pine.jl | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/rose_pine.jl diff --git a/README.md b/README.md index 08152fd..5ce6439 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ Currently the following themes are available: - `:mute` - `:dao` - `:dracula` +- `:rose_pine` +- `:rose_pine_dawn` When using Plots, a theme can be set using the `theme` function: @@ -96,6 +98,12 @@ Themes can be previewed using `Plots.showtheme(thm::Symbol)`: ### `:dracula` ![theme_dracula](https://user-images.githubusercontent.com/64332767/136754217-31d4348a-c873-4496-8b66-905e4d8a7e36.png) +### `:rose_pine` +![theme_rose_pine](https://github.com/BaerLKR/PlotThemes.jl/assets/83340886/30c869e5-2b90-405a-bc49-cf4ef3c43d75) + +### `:rose_pine_dawn` +![theme_rose_pine_dawn](https://github.com/BaerLKR/PlotThemes.jl/assets/83340886/e30c0b46-1be3-49f5-afc5-ceede0b0c27d) + ## Contributing A theme specifies default values for different Plots [attributes](https://docs.juliaplots.org/stable/attributes/). At the moment these are typically colors, palettes and colorgradients, but any Plots attribute can be controlled by a theme in general. diff --git a/src/PlotThemes.jl b/src/PlotThemes.jl index 907ab30..08377bf 100644 --- a/src/PlotThemes.jl +++ b/src/PlotThemes.jl @@ -47,6 +47,7 @@ include("gruvbox.jl") include("sheet.jl") include("dao.jl") include("dracula.jl") +include("rose_pine.jl") const _themes = Dict{Symbol, PlotTheme}([ @@ -67,7 +68,10 @@ const _themes = Dict{Symbol, PlotTheme}([ :juno => _juno, :lime => _lime, :orange => _orange, - :dracula => _dracula + :dracula => _dracula, + :rose_pine => _rose_pine, + :rose_pine_dawn => _rose_pine_dawn + ]) diff --git a/src/rose_pine.jl b/src/rose_pine.jl new file mode 100644 index 0000000..b597560 --- /dev/null +++ b/src/rose_pine.jl @@ -0,0 +1,46 @@ +# https://rosepinetheme.com +const rose_pine_palette = [ + colorant"#524f67", # Highlight High + colorant"#31748f", # pine + colorant"#9ccfd8", # foam + colorant"#ebbcba", # rose + colorant"#f6c177", # gold + colorant"#eb6f92", # love + colorant"#c4a7e7", # Iris +] + +const rose_pine_bg = colorant"#191724" + +const _rose_pine = PlotTheme(Dict([ + :bg => rose_pine_bg, + :bginside => colorant"#1f1d2e", + :fg => colorant"#e0def4", + :fgtext => colorant"#e0def4", + :fgguide => colorant"#e0def4", + :fglegend => colorant"#e0def4", + :palette => expand_palette(rose_pine_bg, rose_pine_palette), + :colorgradient => cgrad(rose_pine_palette)]) +) + +const rose_pine_dawn_palette = [ + colorant"#907aa9", # Iris + colorant"#286983", # pine + colorant"#56949f", # foam + colorant"#cecacd", # Highlight High + colorant"#ea9d34", # gold + colorant"#d7827e", # rose + colorant"#b4637a", # love +] + +const rose_pine_dawn_bg = colorant"#faf4ed" + +const _rose_pine_dawn = PlotTheme(Dict([ + :bg => rose_pine_dawn_bg, + :bginside => colorant"#fffaf3", + :fg => colorant"#575279", + :fgtext => colorant"#575279", + :fgguide => colorant"#575279", + :fglegend => colorant"#575279", + :palette => expand_palette(rose_pine_dawn_bg, rose_pine_dawn_palette), + :colorgradient => cgrad(rose_pine_dawn_palette)]) +)