Custom blending rule: threshold
First the TL;DR. I want to create a custom blending rule so that I compare the brightness of two layers and compute an output value of white or black depending on which one is greater. Is there a way to do this?
For those interested in what I'm going for, I have in mind this idea::
First, imagine a linear gradient, from black to white (moving left to right). Call this layer L1.
Then imagine a honeycomb of black hexagons -- BUT, there is a lot of white space between the hexagons which have a thick white stroke separating them. Call this layer L2.
Now, **blur** L2 a little so that the dark centers of the hexagons bleed into the white stroke and the white stroke becomes a little gray. So now it looks like fuzzy hexagons. Call this layer L3.
Now I wan to blend L1 and L3 as follows: the resulting layer R1 will have a black pixel wherever L3 (the fuzzy hexagon) is darker than L1 (the gradient). Otherwise it will have a white pixel.
Imagine the final result: on the right, it will all black, because every part of the fuzzy hexagons will be darker than the white on the right side of the gradient L1.
As you move to the left, only the darkest core of the fuzzy hexagons will be darker than L1, so you'll start to see, on R1, separated hexagons.
As you move all the way to the left the hexagons become smaller and more separated.


