I've noticed that when overlaying colours with alpha < 1.0, the result depends on the order in which the colours are added. For example, green on red produces a dark green, whereas red on green gives brown.
The attached bit of code shows what I mean: it shows that rgba(1, 0, 0, 0.5) covered by rgba(0, 1, 0, 0.5) gives rgba(0.33, 0.67, 0, 0.75), but rgba(0, 1, 0, 0.5) covered by rgba(1, 0, 0, 0.5) gives rgba(0.67, 0.33, 0, 0.75).
This is probably done for a good reason, but I'd like to be able to mix colours evenly, so that, for example, rgba(1,0,0,0.5) plus rgba(0,1,0,0.5) always gives rgba(0.5, 0.5, 0, 0.75), irrespective of which is drawn first.
Is there a way of doing that? I couldn't find the bit in the code that sets the one-third/two thirds ratio.
I've noticed that when overlaying colours with alpha < 1.0, the result depends on the order in which the colours are added. For example, green on red produces a dark green, whereas red on green gives brown.
The attached bit of code shows what I mean: it shows that rgba(1, 0, 0, 0.5) covered by rgba(0, 1, 0, 0.5) gives rgba(0.33, 0.67, 0, 0.75), but rgba(0, 1, 0, 0.5) covered by rgba(1, 0, 0, 0.5) gives rgba(0.67, 0.33, 0, 0.75).
This is probably done for a good reason, but I'd like to be able to mix colours evenly, so that, for example, rgba(1,0,0,0.5) plus rgba(0,1,0,0.5) always gives rgba(0.5, 0.5, 0, 0.75), irrespective of which is drawn first.
Is there a way of doing that? I couldn't find the bit in the code that sets the one-third/two thirds ratio.
Here's my code: