TeXnicians,如何将 RGB 颜色值转换为等效的 CMYK 颜色值?请参阅以下 MWE 文件:
\documentclass[draft]{book}
\usepackage{color,}
\definecolor{rgbcolor}{rgb}{0.686,0.059,0.569}
%\definecolor{cmykcolor}{cmyk}{0, 0, 0, 0}
\begin{document}
\textcolor{rgbcolor}{This is RGB color}
%\textcolor{cmykcolor}{This is Equivalent for converted RGB to CMYK color}
\end{document}
答案1
您可以使用xcolor
包
\documentclass[draft]{book}
\usepackage{xcolor}
\definecolor{rgbcolor}{rgb}{0.686,0.059,0.569} %\definecolor{cmykcolor}{cmyk}{0, 0, 0, 0}
\convertcolorspec{named}{rgbcolor}{cmyk}\tmp
\definecolor{cmykcolor}{cmyk}{\tmp}
\begin{document}
\textcolor{rgbcolor}{This is RGB color}
\textcolor{cmykcolor}{This is Equivalent for converted RGB to CMYK color}.
The computed values are: \tmp.
\end{document}