Custom color without defining new color

color

I want to do something like

{\color{rgb}{200,100,30}color text}

instead of doing

\definecolor{mycolor}{rgb}{200,100,30}
{\color{mycolor}color text}

How can I achieve this? I am having difficulty understanding the xcolor pdf manual, so I am hoping someone here can help. I think it might be possible to do this using LuaLateX scripting, but I have never used LuaLaTeX and I am hoping there is an easier way.

Best Answer

The model name (rgb) is mandatory when defining colors (so in {...}) but optional in \color and \textcolor where the default is to take a defined color name. Optional arguments are in [...] so

 {\color[RGB]{200,100,30}...}

Note you need RGB color model if the arguments are integers 0-255, rgb takes numbers in the range 0-1