N
N
Nikita Gavrikov2016-06-14 16:57:10
Canvas
Nikita Gavrikov, 2016-06-14 16:57:10

How to draw a translucent line on Canvas without overlaying color?

Hello everyone, I have a problem here.
I'm doing a small drawing and according to the assignment I need to be able to draw lines on the canvas with different levels of transparency.
Here is an example of such a drawing tool:
https://jsfiddle.net/08cw6mh7/
the problem is the following: if you draw, set the fill color, for example, rgba (50, 100, 150, 1), then everything works well because the transparency is 1. And when you move the mouse, the colors although they overlap each other, but due to the full opacity it is not noticeable. But if you start changing the transparency, for example, rgba (50, 100, 150, .25), then trash begins - the colors begin to overlap and it turns out not to be a uniformly transparent line, but it's not clear what. What can be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GreatRash, 2016-06-14
@gavrikoff13

https://jsfiddle.net/goqzdsxu/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question