Yes, there is a general formula. Consider an urn containing $M$ balls, where $M_1$ balls have the color $c_1$, $M_2$ balls have the color $c_2$,..., $M_r$ balls have the color $c_r$, and $M_1+\cdots+M_r=M$. If you draw a sample of size $n<m$ without replacement the sample space is $$\Omega=\{\omega\colon \omega=(a_1,\dots,a_n), a_i\ne a_j, i\ne j\}$$and $|\Omega|=(M)_n=\frac{M!}{(M-n)!}$. Consider an event $B_{n_1,\dots,n_r}$ in which $n_1$ balls have color $c_1$,..., $n_r$ balls have color $c_r$, where $n_1+\cdots+n_r=n$. The $c_1$ balls can get $C_n^{n_1}=\binom{n}{n_1}=\frac{n!}{(n-n_1)!n_1}$ sets of $n_1$ indexes in $(a_1,\dots,a_n)$, the $c_2$ balls can get $C_{n-n1}^{n_2}$ sets of $n_2$ indexes, etc., and you can choose $(M_i)_{n_i}=\frac{M_i!}{(M_i-n_i)}$ balls that have color $c_i$. The general number of events is:$$\begin{align*}|B|&=\frac{n!}{(n-n_1)!n_1!}\frac{(n-n_1)!}{(n-n_1-n_2)!n_2!}\cdots\frac{(n-n_1-\dots-n_{r-1})!}{(n-n_1-\cdots-n_r)!n_r!}\prod_{i=1}^r (M_i)_{n_i}\\&=\frac{n!}{(n-n_1)!n_1!}\frac{(n-n_1)!}{(n-n_1-n_2)!n_2!}\cdots\frac{n_r!}{0!n_r!}\prod_{i=1}^r (M_i)_{n_i}\\&=\frac{n!}{n_1!\cdots n_r!}\frac{M_1!}{(M_1-n_1)!}\cdots\frac{M_r!}{(M_r-n_r)!}\\&=n!C_{M_1}^{n_1}\cdots C_{M_r}^{n_r}\end{align*}$$and$$P(B)=\frac{|B|}{|\Omega|}=\frac{n!C_{M_1}^{n_1}\cdots C_{M_r}^{n_r}}{(M)_n}=\frac{C_{M_1}^{n_1}\cdots C_{M_r}^{n_r}}{C_M^n}$$
The set of probabilities $\{P(B_{n_1,\dots,n_r})\}$ is called the multivariate hypergeometric distribution. See Shiryaev, Probability, 1996, or Probability 1, 2016, Chapter 1, §2.
If you are using R to compute $P(B)$, you can install the extraDistr
package:
> library(extraDistr)
> K <- 10 # sample size
> x <- subset(expand.grid(red=0:20, blue=0:15, green=0:10, gray=0:5, yellow=0:5, violet=0:5), red+blue+green+gray+yellow+violet==K)
> dim(x)
[1] 2625 6
> head(x)
red blue green gray yellow violet
11 10 0 0 0 0 0
31 9 1 0 0 0 0
51 8 2 0 0 0 0
71 7 3 0 0 0 0
91 6 4 0 0 0 0
111 5 5 0 0 0 0
> tail(x)
red blue green gray yellow violet
739201 0 0 0 2 3 5
753986 1 0 0 0 4 5
754006 0 1 0 0 4 5
754321 0 0 1 0 4 5
757681 0 0 0 1 4 5
776161 0 0 0 0 5 5
> p <- dmvhyper(x, n=c(20,15,10,5,5,5), k=K)
> max(p)
[1] 0.008930581
> x[which.max(p),]
red blue green gray yellow violet
159646 3 2 2 1 1 1
> dmvhyper(x[which.max(p),], n=c(20,15,10,5,5,5), k=K)
[1] 0.008930581
> choose(20,3)*choose(15,2)*choose(10,2)*5*5*5/choose(60,K)
[1] 0.008930581