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

Marker opacity #95

Closed
comcloudway opened this issue Nov 29, 2022 · 7 comments
Closed

Marker opacity #95

comcloudway opened this issue Nov 29, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@comcloudway
Copy link
Contributor

Would it be possible to have the marker draw the lines with 80% opacity?
Currently, drawing a yellow line and a blue line results in only the blue being visible at a given point.
Current saber implementation

I think it might make more sense to have them overly above one another
quick krita sketch
As you can see, the yellow line can still be seen through the blue one.

I'm actually not sure, if this might be solved by #42 (if one would be able to set the alpha value for a given color)

@adil192
Copy link
Member

adil192 commented Nov 29, 2022

This was done deliberately as it looks a lot cleaner when it doesn't overlap. Imagine highlighting a multi-line maths formula and you get that ugly overlap streak in the middle!
Is being able to see the overlap an important feature for you? or just an aesthetic choice?

@comcloudway
Copy link
Contributor Author

I think I do understand why you have them set to be solid colours.
I mean, this does look like a hightmap.
bad overlap example
Which is why I would not force this, but have it as an optional feature:

But looking at how real-life markers work, the behaviour seemed somewhat off.

So no, it is not an important feature, (I have yet to check the code) but in case you are already using RGBA colours,
I think that adding the ability to change the alpha (in case one will be able to pick custom colours at some point) should not be that bad.

Right now it just seems like it is a solid colour (but I like the layer approach)

@comcloudway
Copy link
Contributor Author

If I'm not mistaken you use the Flutter Color class for the colours, which does appear to have a withAlpha and withOpacity method, so it should be able to make this an optional feature in the future.

@adil192
Copy link
Member

adil192 commented Nov 29, 2022

Implementation-wise it's a little bit more complicated than that before of the layer system, but it's more of a matter of preference than difficulty. I may revisit this in the future to see if I can get both

  • the same color highlighter strokes not to overlap
  • different-colored highlighter strokes to overlap

@comcloudway
Copy link
Contributor Author

I have to get back into flutter (if I manage to get it running without glibc),
but couldn't you sort the strokes by colour and then use saveLayer to separate the colours into separate layers and set the paint blend mode to opacity?

Or would that also overlay the same colours?

But I honestly really like the idea of having different colours overlap, whilst the same colour extends the current highlighted area, because that makes highlighting larger areas so much more easy

@adil192
Copy link
Member

adil192 commented Nov 29, 2022

I have to get back into flutter (if I manage to get it running without glibc)

Are you perhaps talking about this issue flutter/flutter#115909? The fix for that is to do sudo apt install lib32stdc++-12-dev

but couldn't you sort the strokes by colour and then use saveLayer to separate the colours into separate layers and set the paint blend mode to opacity?

That's what I was thinking too. I'm just finishing off some other features right now so I'll get to it later

@comcloudway
Copy link
Contributor Author

comcloudway commented Nov 29, 2022

I'm on Alpine Linux, which uses muslc instead of glibc and apk as a package manager,
so I'm kind of talking about flutter/flutter#73260.

I'm trying to manually replace the dart install shipped with flutter with the system dart SDK, but this seems to break flutters snapshot system.

@adil192 adil192 added the enhancement New feature or request label Dec 1, 2022
@adil192 adil192 closed this as completed in 531c877 Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants