fix fg_color
This commit is contained in:
parent
5af5ec7313
commit
70d0d786e2
18
src/args.jl
18
src/args.jl
@ -1379,18 +1379,18 @@ Base.get(series::Series, k::Symbol, v) = get(series.plotattributes, k, v)
|
|||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
function fg_color(plotattributes::Attr)
|
function fg_color(plotattributes::AKW)
|
||||||
fg = plotattributes[:foreground_color]
|
fg = get(plotattributes, :foreground_color, :auto)
|
||||||
if fg == :auto
|
if fg == :auto
|
||||||
bg = plot_color(plotattributes[:background_color])
|
bg = plot_color(get(plotattributes, :background_color, :white))
|
||||||
fg = isdark(bg) ? colorant"white" : colorant"black"
|
fg = isdark(bg) ? colorant"white" : colorant"black"
|
||||||
else
|
else
|
||||||
plot_color(fg)
|
plot_color(fg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function fg_color_sp(plotattributes::Attr)
|
function fg_color_sp(plotattributes::AWK)
|
||||||
fgsp = plotattributes[:foreground_color_subplot]
|
fgsp = get(plotattributes, :foreground_color_subplot, :match)
|
||||||
if fg == :match
|
if fg == :match
|
||||||
fg_color(plotattributes)
|
fg_color(plotattributes)
|
||||||
else
|
else
|
||||||
@ -1402,11 +1402,9 @@ end
|
|||||||
|
|
||||||
# update attr from an input dictionary
|
# update attr from an input dictionary
|
||||||
function _update_plot_args(plt::Plot, plotattributes_in::AKW)
|
function _update_plot_args(plt::Plot, plotattributes_in::AKW)
|
||||||
# TODO do merged kws need to be removed from plotattributes_in?
|
for (k,v) in _plot_defaults
|
||||||
merge!(plt.attr, plotattributes_in)
|
slice_arg!(plotattributes_in, plt.attr, k, 1, true)
|
||||||
# for (k,v) in _plot_defaults
|
end
|
||||||
# slice_arg!(plotattributes_in, plt.attr, k, v, 1, true)
|
|
||||||
# end
|
|
||||||
|
|
||||||
# handle colors
|
# handle colors
|
||||||
plotattributes= plt.attr
|
plotattributes= plt.attr
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user