  We show that for all $\ell$ and $\epsilon>0$ there is a constant
$c=c(\ell,\epsilon)>0$ such that every $\ell$-coloring of the triples of an
$N$-element set contains a subset $S$ of size $c\sqrt{\log N}$ such that at
least $1-\epsilon$ fraction of the triples of $S$ have the same color. This
result is tight up to the constant $c$ and answers an open question of
Erd\H{o}s and Hajnal from 1989 on discrepancy in hypergraphs. For $\ell \geq 4$
colors, it is known that there is an $\ell$-coloring of the triples of an
$N$-element set whose largest monochromatic subset has cardinality only
$\Theta(\log \log N)$. Thus, our result demonstrates that the maximum almost
monochromatic subset that an $\ell$-coloring of the triples must contain is
much larger than the corresponding monochromatic subset. This is in striking
contrast with graphs, where these two quantities have the same order of
magnitude. To prove our result, we obtain a new upper bound on the $\ell$-color
Ramsey numbers of complete multipartite 3-uniform hypergraphs, which answers
another open question of Erd\H{o}s and Hajnal.
