|
158 | 158 | # Geom.ribbon in particular so lines stand out against it.
|
159 | 159 | lowlight_color, Function, default_lowlight_color
|
160 | 160 |
|
161 |
| - # Opacity of geometry filled with lowlight_color |
162 |
| - lowlight_opacity, Float64, 0.6 |
163 | 161 |
|
164 | 162 | # A function mapping base fill color to the color of the median marker in a
|
165 | 163 | # boxplot.
|
|
393 | 391 | A light foreground on a dark background.
|
394 | 392 | """
|
395 | 393 | get_theme(::Val{:dark}) = dark_theme
|
| 394 | + |
| 395 | + |
| 396 | + |
| 397 | +# Outer constructor for Theme argument depwarns |
| 398 | + |
| 399 | +function Theme(; |
| 400 | + default_color::ColorOrNothing=LCHab(70, 60, 240), |
| 401 | + point_size::Measure=0.9mm, |
| 402 | + point_size_min::Measure=0.45mm, |
| 403 | + point_size_max::Measure=1.8mm, |
| 404 | + point_shapes::Vector{Function}=[Shape.circle, Shape.square, Shape.diamond, Shape.cross, Shape.xcross, Shape.utriangle, Shape.dtriangle, Shape.star1, Shape.star2, Shape.hexagon, Shape.octagon, Shape.hline, Shape.vline], |
| 405 | + line_width::Measure=0.3mm, |
| 406 | + line_style::Union{Symbol,Vector}=:solid, |
| 407 | + panel_fill::ColorOrNothing=nothing, |
| 408 | + panel_stroke::ColorOrNothing=nothing, |
| 409 | + panel_opacity::Float64=1.0, |
| 410 | + background_color::ColorOrNothing=nothing, |
| 411 | + plot_padding::(Vector{<:Measure})=[5mm], |
| 412 | + grid_color::ColorOrNothing=colorant"#D0D0E0", |
| 413 | + grid_line_style::Union{Symbol,Vector}=[0.5mm, 0.5mm], |
| 414 | + grid_color_focused::ColorOrNothing=colorant"#A0A0A0", |
| 415 | + grid_line_width::Measure=0.2mm, |
| 416 | + minor_label_font::AbstractString=label_font_desc, |
| 417 | + minor_label_font_size::Measure=8pt, |
| 418 | + minor_label_color::ColorOrNothing=colorant"#6c606b", |
| 419 | + major_label_font::AbstractString=title_font_desc, |
| 420 | + major_label_font_size::Measure=11pt, |
| 421 | + major_label_color::ColorOrNothing=colorant"#564a55", |
| 422 | + point_label_font::AbstractString=label_font_desc, |
| 423 | + point_label_font_size::Measure=8pt, |
| 424 | + point_label_color::ColorOrNothing=colorant"#4c404b", |
| 425 | + key_title_font::AbstractString=title_font_desc, |
| 426 | + key_title_font_size::Measure=11pt, |
| 427 | + key_title_color::ColorOrNothing=colorant"#362a35", |
| 428 | + key_label_font::AbstractString=title_font_desc, |
| 429 | + key_label_font_size::Measure=8pt, |
| 430 | + key_label_color::ColorOrNothing=colorant"#4c404b", |
| 431 | + key_color_gradations::Int=40, |
| 432 | + bar_spacing::Measure=-0.05mm, |
| 433 | + boxplot_spacing::Measure=1mm, |
| 434 | + errorbar_cap_length::Measure=3mm, |
| 435 | + stroke_color::Function=default_stroke_color, |
| 436 | + highlight_width::Measure=0.3mm, |
| 437 | + discrete_highlight_color::Function=default_discrete_highlight_color, |
| 438 | + continuous_highlight_color::Function=default_continuous_highlight_color, |
| 439 | + lowlight_color::Function=default_lowlight_color, |
| 440 | + lowlight_opacity::Float64=NaN, |
| 441 | + middle_color::Function=default_middle_color, |
| 442 | + middle_width::Measure=0.6mm, |
| 443 | + guide_title_position::Symbol=:left, |
| 444 | + colorkey_swatch_shape::Symbol=:square, |
| 445 | + key_swatch_shape::Function=Shape.square, |
| 446 | + key_swatch_color::ColorOrNothing=nothing, |
| 447 | + key_position::Symbol=:right, |
| 448 | + bar_highlight::Union{(Void), Function, Color}=nothing, |
| 449 | + rug_size::Measure=2.0mm, |
| 450 | + label_placement_iterations::Int=1000, |
| 451 | + label_out_of_bounds_penalty::Float64=10.0, |
| 452 | + label_hidden_penalty::Float64=0.5, |
| 453 | + label_visibility_flip_pr::Float64=0.2, |
| 454 | + label_padding::Measure=1mm, |
| 455 | + key_max_columns::Int=4, |
| 456 | + discrete_color_scale::Scale.DiscreteColorScale=Scale.color_discrete(), |
| 457 | + continuous_color_scale::Scale.ContinuousColorScale=Scale.color_continuous() |
| 458 | +) |
| 459 | + |
| 460 | + isfinite(lowlight_opacity) && Base.depwarn("The keyword argument `lowlight_opacity` has been deprecated, and never worked anyway!", :Theme) |
| 461 | + |
| 462 | +return Theme(default_color, point_size, point_size_min, point_size_max, point_shapes, line_width, line_style, panel_fill, panel_stroke, panel_opacity, background_color, |
| 463 | + plot_padding, grid_color, grid_line_style, grid_color_focused, grid_line_width, |
| 464 | + minor_label_font, minor_label_font_size, minor_label_color, major_label_font, major_label_font_size, major_label_color, |
| 465 | + point_label_font, point_label_font_size, point_label_color, key_title_font, key_title_font_size, key_title_color, key_label_font, key_label_font_size, key_label_color, |
| 466 | + key_color_gradations, bar_spacing, boxplot_spacing, errorbar_cap_length, stroke_color, highlight_width, discrete_highlight_color, continuous_highlight_color, |
| 467 | + lowlight_color, middle_color, middle_width, guide_title_position, colorkey_swatch_shape, key_swatch_shape, key_swatch_color, key_position, bar_highlight, |
| 468 | + rug_size, label_placement_iterations, label_out_of_bounds_penalty, label_hidden_penalty, label_visibility_flip_pr, label_padding, key_max_columns, |
| 469 | + discrete_color_scale, continuous_color_scale) |
| 470 | + |
| 471 | +end |
| 472 | + |
0 commit comments