File `xcolor.sty' not found

xcolor is a LaTeX package. Try to install it first before using it, and then add the following in the YAML section:

header-includes:
- \usepackage{xcolor}

I hope it'll work. I haven't tested it myself, though.