3

Often I use xcolor package also to create several and customize kinds of colors.

Many times I use the combination of the page 33 because it's understandable to me:

enter image description here

But to find the exact shade of color, I do a lot of tests, which take even a few hours. Sometimes I use the colors of dvipsnames, via svgnames, via x11names.

I ask if somebody knows an online tool (or a specific formula) that convert me directly an RGB color with a code like, for example, blue!50!yellow. This question is closely connected to another one that you can find on this link:

https://graphicdesign.stackexchange.com/questions/120490/as-to-known-the-colors-used-in-an-image

I don't want to define a long list of \definecolor{name}{model}{color-spec} (for example \definecolor{ultramarine}{RGB}{0,32,96}) because I forget all the custom colors that I have customized.

  • 4
    Why don't you use the RGB color value and just define the color that way (give it a name)? Maybe I just don't understand your question… – TeXnician Mar 29 at 20:47
  • 1
    Is not enough \testcolor ? Please see here – Fran Mar 29 at 22:52
  • 2
    @Sebastiano What image? Just compile the code posted with pdflatex and you will see that image in a PDF.! So you can add a bestcolors environment in your working document to test any (already defined) color to see how exactly can be defined in any format and how exactly look like in a box (much better than simply look at the colored text or thin lines of the document, where it can be harder appreciate the true tone). What else? – Fran Mar 30 at 6:42
  • 1
    Buy one of these (while not looking at the price): pantone.com/products/graphics/color-bridge-coated, then define that long list of colours (that you don't want to do). At least it will give you chromatically sorted sensibly named colours that conform to some kind of standard. The bridge fans provide the spot colour, approx RGB colour, and nearest CMYK colour. My big list of colours then includes lines like this \definecolor{PANTONE-3514-CP}{RGB/cmyk}{237,174,0/0.0,0.27,1.0,0.0} in a style file and I just specify the colour model I want before loading the style. – David Purton Mar 30 at 15:02
  • 2
    @Sebastiano I guess that this would be a bit complex. Suppose that you a a RGB color of f 0.5 0.5 0.5 what should LaTeX automatically produce? black!50!white? or why not white!50!black? or simply black!50 ? or simply gray? ... or why not mycolor? – Fran Mar 30 at 20:20
7

You can search the internet with rgb to cmyk to find free online calculators to change an rgb color to an cmyk color. In this case it is important to respect the color profile the printer supposed to print your document is using.

For example you can have a look to https://www.rgb2cmyk.org/ or https://www.pdf2cmyk.com/ for pdf file.

With LaTeX you can use \testcolor (as mentioned in an comment by @Fran, see his answer here) to get an first idea of the used color in different models but that does not respect the needed color profile of the printer ...

At last the only one who can tell you which color values gives the printed color you want is the printing house you use to publish your document.

Why are colors problematic?

Let us have a look on rgb colors. They are used on monitors or screens. And that is the problem: the shown color depends on the configuration of the monitor (contrast, brightness). In other words: if you change the monitor (or the complete computer) you will see other colors displayed, but still using the same color value in rgb or cmyk.

To make things worse the used color modell to print colors on paper is cmyk. And again the real printed color depends on the used paper (thickness, color of paper) and the used printer, its used ink or toner and the used color profile.

So you can get different printed colors by using the same cmyk value!

To make things more worse the available colors in rgb model and cmyk model are not the same, some of them for example do not exist in the other color model.

To change a rgb value to cmyk (by exactly the rip software of the printing system) there are calculations neseccary resulting in rounding errors. So if you use a rgb value in your latex code/pdf file you can not be sure which cmyk value results.

Conclusion:

To get the best result talk to the printing house publishing your book/document. Ask them which cmyk values for the colors you should use to get the expected result. I'm sure they will ask you not to use too much colors.

Now use \definecolor{name}{model}{color-spec} in your LaTeX code like

\definecolor{myred}{cmyk}{0,1,1,0}

to use the named color in your document with \textcolor{myred}{This is in red!} or simular. Or you can name the colors after the reason to use, for example in section, chapter, etc. to be able to remember it easier ...

The main advantage now is that you can very easy change the color value depending on your printing house.

Conclusion:

  1. Talk with the printing house to define proper printing colors for your document.
  2. Use the given color values.
  3. Ignore the shown colors on your monitor. Only the printed result is important. (The only way to get the printed colors shown on the screens you need an expensive special printing system!)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.