Skip to content
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

Opacity does not work #7

Open
idontgetoutmuch opened this issue Sep 14, 2013 · 3 comments
Open

Opacity does not work #7

idontgetoutmuch opened this issue Sep 14, 2013 · 3 comments

Comments

@idontgetoutmuch
Copy link
Member

In this example all circles have the same opacity

import Diagrams.Prelude
import Diagrams.Backend.Postscript
import Diagrams.Backend.Postscript.CmdLine
import Data.Colour (withOpacity)

colors  = map (blue `withOpacity`) [0.1, 0.2 .. 1.0]
example = hcat' with { catMethod = Distrib, sep = 1 }
                (zipWith fcA colors (repeat (circle 1)))

main :: IO ()
main = defaultMain example
@byorgey
Copy link
Member

byorgey commented Sep 14, 2013

This is a known problem, e.g. see the description at http://hackage.haskell.org/package/diagrams and also http://projects.haskell.org/diagrams/backend-tests/all-index.html . The problem is simply that Postscript does not support transparency, so there is no way for the diagrams-postscript backend to support the opacity attribute.

It would probably be good to document this better in the diagrams-postscript package itself. I will leave this ticket open for now as a reminder to improve the documentation.

@idontgetoutmuch
Copy link
Member Author

Thanks for this. It is indeed documented but hard to find (or at least I didn't find it). It's not obvious how one could make it clearer though.

BTW with Safari the SVG output in http://projects.haskell.org/diagrams/backend-tests/all-index.html is messed up. I think this is a known issue. I can send a screenshot if necessary.

Dominic Steinitz
[email protected]
http://idontgetoutmuch.wordpress.com

On 14 Sep 2013, at 11:09, Brent Yorgey [email protected] wrote:

This is a known problem, e.g. see the description at http://hackage.haskell.org/package/diagrams and also http://projects.haskell.org/diagrams/backend-tests/all-index.html . The problem is simply that Postscript does not support transparency, so there is no way for the diagrams-postscript backend to support the opacity attribute.

It would probably be good to document this better in the diagrams-postscript package itself. I will leave this ticket open for now as a reminder to improve the documentation.


Reply to this email directly or view it on GitHub.

@fryguybob
Copy link
Member

I don't know how everyone feels about it but we could emit warnings on stderr when we encounter a color with transparency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants