Kyllo,
Sadly, there are NO docs on on how to properly form return types when using customer python nodes within NodeBox. It's a dark art.
I have written about a dozen python modules (available in my Cartan Node Library). Each one was made - with great pain - by sheer trial and error. Over the years I have gained enough knowledge to maybe figure out how to fix your Python code - which I will try to do soon.
But before I do, did you consider making your negative color blend function entirely within Nodebox without the need to call any eternal libraries?
It's fairly easy to do. You can make a subnetwork that takes two color values. For each one you can then use the lookup node to get r, g, and b (red, green, and blue between 0 and 1) for each. You can then do your math with add, subtract, and multiply nodes, and pass the final result into an rgb_color node to return the blended color.
This does involve a bit of careful wiring but you avoid the need to muck about with external libraries.
IN FACT, I have already done this and was planning on releasing it soon. I am currently working on expanding my blend node so that it offers a number of different blending methods, including negative mixing (see screenshot).
BUT I don't want to share my blend node just yet, because I am still working on it and I still have a number of open questions to nail down.
For example, your algorithm does not consider transparency (the alpha value); adding alpha values complicates things a bit but seems pretty important. Some formulas also include an option for gamma correction that tends to produce better results on computer screens. There seem to be a number of different methods or modes for mixing colors, each useful in different contexts, with some disagreement among experts as to how many methods there really are and the best algorithm for each.
I am also weighing the difference between "blending" and "mixing". I already have an inter_color node for mixing based on a T value - useful for gradients or animations - in addition to my blend node which returns a single color. Since I am now adding methods to my blend node I wonder if I should continue having two separate nodes or merge them into a single node. Still pondering that one.
I do hope to have something fairly soon (within a few days).
So please let me know if you:
A) still want help with your Python code,
B) are willing to try making your function entirely in Nodebox, OR
C) prefer to hang tight for a few days until I release my improved blend node
Thanks,
John