Let the number of colors be $k$, the number of balls $2n$, and the number of balls of the $i$-th color be $r_i$, so that $\sum_{i=1}^k r_i=2n$
In terms of generating functions we are looking for the coefficient at $x^n$ in the product:
$$\begin{align}
\prod_{i=1}^k\sum_{j=0}^{r_i}x^j
&=\prod_{i=1}^k\frac{1-x^{r_i+1}}{1-x}\\
&=\frac{\prod_{i=1}^k(1-x^{r_i+1})}{(1-x)^{k}}\\
&=\prod_{i=1}^k(1-x^{r_i+1})\sum_{j=0}^\infty\binom{-k}{j}(-x)^j\\
&=\prod_{i=1}^k(1-x^{r_i+1})\sum_{j=0}^\infty\binom{j+k-1}{j}x^{j}\\
&=\sum_{\boldsymbol{\mu}}(-1)^{|\boldsymbol{\mu}|}x^{\boldsymbol{\mu}\cdot\boldsymbol{r}}
\sum_{j=0}^\infty\binom{j+k-1}{k-1}x^{j},
\end{align}$$
which is
$$
\sum_{\boldsymbol{\mu}}(-1)^{|\boldsymbol{\mu}|}\binom{n-\boldsymbol{\mu}\cdot\boldsymbol{r}+k-1}{k-1},\tag1
$$
where $\boldsymbol{\mu}$ are all $2^k$ binary vectors of the length $k$, $|\boldsymbol{\mu}|=\sum_{i=1}^k\mu_i$ and $\boldsymbol{r}=(r_1+1,r_2+1,\dots,r_k+1)$.
In (1) the binomial coefficient $\binom mn$ is assumed to be $0$ for $m<n$.
Solution for Example 4.
$n=3,k=3,\boldsymbol{r}=(5,2,2):$
$$\binom 52-\binom 32-\binom 32=10-3-3=4.
$$
Best Answer
We start with Stars and Bars
Ignoring the first condition, we get $\binom {N-1}2$
Now, we need to subtract off the cases in which two of the people got the same number of balls. If we specify the two people, that's $\big \lfloor \frac {N-1}2\big \rfloor$, since the third person has to get at least $1$. Of course, there are $3$ ways to specify two people.
Now, we see that we have subtracted off the case in which all three people get the same number of balls $3$ times and we only meant to subtract it once. Thus, in the case where $3\,|\,N$ we must add $2$.
Finally we see that the answer is $$ \begin{cases} \binom {N-1}2-3\big \lfloor \frac {N-1}2\big \rfloor & \text{if $3\nmid N$} \\\\ \binom {N-1}2-3\big \lfloor \frac {N-1}2\big \rfloor +2& \text{if $3\,|\,N$} \end{cases}$$
Sanity Check: If $N=9$ this gives $18$. Indeed, the possible triples are $(6,2,1)$, $(5,3,1)$, and $(4,3,2)$ plus their permutations.