To answer your question, if you use
\usepackage[cmyk]{xcolor}
then all colours will be converted to CMYK regardless of how they are declared.
But xcolor
does not do this in a smart way, so you will not get the best possible match to your RGB colour or any indication of whether it is even possible to reproduce your RGB colour in CMYK (the CMYK colour gamut is smaller than RGB).
Sadly, doing what you want isn't as trivial as you might hope. Here's a discussion of some of the issues and options available to you:
I can use Scribus to convert your blue and orange to CMYK. If I do this using it's default sRGB profile and default CMYK profile, which happens to be ISO Coated v2 300% (basICColor) I get the following two CMYK colours:
\definecolor{managed-cmyk-cg-blue}{cmyk}{0.726,0.357,0.018,0.01}
\definecolor{managed-cmyk-cg-orange}{cmyk}{0.015,0.494,0.907,0}
I can also use xcolor
to do the conversion:
\convertcolorspec{named}{cg-blue}{cmyk}\tmp
\definecolor{xcolor-cmyk-cg-blue}{cmyk}{\tmp}
\convertcolorspec{named}{cg-orange}{cmyk}\tmp
\definecolor{xcolor-cmyk-cg-orange}{cmyk}{\tmp}
These end up being equivalent to:
\definecolor{xcolor-cmyk-cg-blue}{cmyk}{0.5294,0.24706,0,0.20392}
\definecolor{xcolor-cmyk-cg-orange}{cmyk}{0,0.38824,0.85489,0.03137}
Now's let's have a look at things:
\documentclass{article}
\usepackage{booktabs}
\usepackage{xcolor}
\definecolor{cg-blue}{RGB}{68,140,203}
\definecolor{cg-orange}{RGB}{247,148,29}
\definecolor{managed-cmyk-cg-blue}{cmyk}{0.726,0.357,0.018,0.01}
\definecolor{managed-cmyk-cg-orange}{cmyk}{0.015,0.494,0.907,0}
\newcommand{\col}[1]{%
\textcolor{#1}{\vrule width 1cm}}
\begin{document}
\convertcolorspec{named}{cg-blue}{cmyk}\tmp
\definecolor{xcolor-cmyk-cg-blue}{cmyk}{\tmp}
\convertcolorspec{named}{cg-orange}{cmyk}\tmp
\definecolor{xcolor-cmyk-cg-orange}{cmyk}{\tmp}
\begin{tabular}{@{}llll@{}}
\toprule
& RGB & \texttt{xcolor} CMYK & Managed CMYK \\
\midrule
Blue & \col{cg-blue} & \col{xcolor-cmyk-cg-blue} & \col{managed-cmyk-cg-blue} \\
Orange & \col{cg-orange} & \col{xcolor-cmyk-cg-orange} & \col{managed-cmyk-cg-orange} \\
\bottomrule
\end{tabular}
\end{document}
And if I convert the resulting PDF to a PNG using the same profiles, I get a colour match with the managed CMYK colours and your original RGB colours, but a colour shift with xcolor
's CMYK colours. I made this image with ghostscript
where I can specify the RGB and CMYK profiles.
But if I open the PDF in my viewer (zathura
), things look different because zathura
is using a different CMYK profile (and perhaps even a different sRGB profile):
Now if I send a PDF to a printer with the CMYK colours in it, I really have no idea what it will look like. Even if the printer just uses the numbers and does nothing else, output depends on all sorts of variables.
If your printer supplies you with a CMYK profile for you to use, then you can use that to convert your RGB colours to CMYK. But unless your monitor is calibrated and you use it's profile, you can't be sure of the conversion back to RGB, so there's still doubt.
I hardly count as a colour expect. I only know enough to understand that there's a lot I don't get. But it seems like the print industry is moving more and more towards an RGB workflow where you work in RGB and provide your file to your printer in RGB tagged with a CMYK output intent. The printer then uses that intent and their own profile to do the final conversion to CMYK. In LaTeX you can do this by using the pdfx
package to produce a PDF/X-3 file. I've never done this, and since I don't have a calibrated monitor there isn't much point anyway.
I've only printed with cheap printers that just say "use CMYK" without giving any details. I've printed the same file with the same CMYK colours on different print runs with them and gotten back very different outputs. I'm not doing branding where colour has to be exactly right, so I just put up with generic profiles and not really knowing what I'll get until it comes back.
xcolor
only has very simplistic conversion from RGB to CMYK and you should not rely on it for colour critical work. However, your problems won't just go away because you provide CMYK colours as what you see on screen will still likely not match what will be printed. In the end you have two options: 1) decide not to care about colour and make do with the approximation of your pdf reader, or 2) invest a significant amount of time learning how colour works, while making sure your printer can guarantee colour from a fully colour managed workflow.