  We generalize Brooks's theorem to show that if $G$ is a Borel graph on a
standard Borel space $X$ of degree bounded by $d \geq 3$ which contains no
$(d+1)$-cliques, then $G$ admits a $\mu$-measurable $d$-coloring with respect
to any Borel probability measure $\mu$ on $X$, and a Baire measurable
$d$-coloring with respect to any compatible Polish topology on $X$. The proof
of this theorem uses a new technique for constructing one-ended spanning
subforests of Borel graphs, as well as ideas from the study of list colorings.
We apply the theorem to graphs arising from group actions to obtain factor of
IID $d$-colorings of Cayley graphs of degree $d$, except in two exceptional
cases.
