Question: I tried looking for the answer, and this is my first post, so bear with me if I mess up in some way. 

Basically my problem is this: I'm writing an extension for Chrome that uses jQuery. I have another extension that makes a timed $.ajax() request every 10 seconds. I need to find a way to run my code every time that timed ajax request and its callback function completes. Setting a timer for my own script can be done, although that's rather half-assed and doesn't work as well.

The problem can be illustrated thus:

```
//extension 1
function timedFunc() {
   setTimeout(doStuff, 10000);
};
timedFunc();

//extension 2
//code to be run every time doStuff completes

```

I feel like there may be a very elementary solution to this problem but I appreciate the help.

Answer: 
The CMY color space, which addresses this kind of subtractive blending, is basically the inverted RGB space. You can add colors in CMY space and convert them back into RGB.

```
CYAN (100 CMY) + MAGENTA (010 CMY) = (110 CMY) = (001 RGB) = BLUE
CYAN (100 CMY) + YELLOW (001 CMY) = (101 CMY) = (010 RGB) = GREEN
...
RED (100 RGB) + YELLOW (001 CMY) = (011 CMY) + (001 CMY) = (012 CMY) => (0 0.5 1 CMY) = (1 0.5 0 RGB) = ORANGE
RED (011 CMY) + BLUE (110 CMY) = (121 CMY) => (0.5 1 0.5 CMY) = (0.5 0 0.5 RGB) = PURPLE

```

As you see, you have to normalize the color, if there are components with values greater than 1.

---

I just realized that the last addition (YELLOW + BLUE) does not work with this model. I leave the answer here, though. Maybe it can help you. That's probably because your examples may contain an inconsistency. If CYAN+YELLOW=GREEN, it is very unlikely that the same GREEN can be generated with BLUE+YELLOW.
I doubt there is one best answer for this question. If you only want substractive color space, [CMY(K)](http://en.wikipedia.org/wiki/CMYK) could be enough. If you however want to create something similar to ArtRage rather than pure Photoshop, implementing your own blending curves is a must for realistic effects.