Calculate blend mode colors

In my case, I have a background color #333 and a "+" layer with blend mode difference. The blend mode is evidently so that the "+" is always nicely visible for any background color variation. But the default value for the background is #333.

Now I don’t know what color I have to input for the "+" so that it looks against the default #333 as if the "+" had a color of #eee for blend mode normal. #eee and difference is darker than #eee and normal; darker than what I want.

Is there some sort of formula or online calculator for these sort of things? Or maybe the graphic editing app I need it for (Inkscape 0.92.3) has it somewhere?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

This is not possible using the Difference Blend Mode with your chosen background color (#333333).

The math formula for the difference blend mode is (B-A). B is the background color and A is the foreground color.The result will always be a positive number (disregard the negative).

In RGB your background color (#333333) is 51,51,51- Your foreground color (#eeeeee) is 238,238,238. The "difference" of these 2 colors is 187,187,187 (always a positive number). This is the "darker color" you see with these colors and the difference blend mode applied.

Even using pure white (255,255,255) as a foreground color your blended color is 204,204,204. That is the closest you can get to your desired (238,238,238) using the difference blend mode and your chosen background and foreground color.

One option to achieve your desired "blended color" using the difference blend mode is to use pure white as your foreground color (255,255,255) and change your background color to (17,17,17). This will result in your "blended color" being #eeeeee (238,238,238).

note- this is color theory and no direct connection to inkscape. I do not use inkscape so I am not familiar with it’s particulars.

Solution 2

I’ve used this one recently, it basically does what you’re describing: takes 2 colors and a number of in-between steps (max. 10), then calculates blending colors:

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply