-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fillopacity: new issues #318
Comments
i think #316 was on the right track, and all that needs to be added to it is to change the definition of the SVG spec permits one to use either RGB or RGBA for fill colors. |
I think updating |
I've been testing some new code using the svg set_default_graphic_size(4cm,4cm)
img = compose(context(),
(context(), circle(0.5,0.5,0.3), fill(HSVA(45,1,1,0.5)), fillopacity(0.3) )
)
draw(SVG(), img) There are two choices: Option ii) will take a bit more work then option i). |
I think option i is reasonable, especially since this is the default behavior of SVG. If the user provides a RGBA color with A ⊄ {0, 1} and |
@tlnagy, @bjarthur
Here is a MWE of the subsequent #314 issue in Compose (this example reproduces the code in Gadfly's
Guide.background
). Note the comments:The reason that error occurs is that
fill(nothing)
is RGBA(0,0,0,0), and hence in svg "fill-opacity=0" gets printed twice: once fromfill(nothing)
and once fromfillopacity(0.0)
.Perhaps a warning should be thrown in
Compose
- suggesting to the user that they can't use any xxxA fill color e.g.RGBA(0,0,0,0)
andfillopacity()
together for svg i.e. you can't specify the fill opacity twice for svg.In Gadfly, there are two options to solve the issue:
i) make
theme.panel_fill
a e.g. RGBA color (it is), and deprecatetheme.panel_opacity
ii) make
theme.panel_fill
a e.g. RGB color, and usetheme.panel_opacity
to control opacityNote that option i) is actually what is done in Gadfly's
render(plot::Plot)
function, which has afill(nothing)
statement, and nofillopacity()
statement, becausefill(nothing)
isRGBA(0,0,0,0)
.Thoughts?
The text was updated successfully, but these errors were encountered: