1

(Disclaimer: I don't understand well color models.)

For a document, to be typeset thanks to LaTeX, I have:

  • a “dark” color (DC for short): CMYK(1,.60,.10,0),
  • a “light” color (LC for short): CMYK(1,.35,0,0),
  • many other colors derived from these two ones (e.g. one of them is a mixture of DC at 65% and white at 35%).

Now, I'm asked to change to “global” colors of the document and for this, I could (just) redefine the “dark” and “light” colors.

But I wonder if it is possible to just define a new “dark” color (NDC for short) and derive the new “light” color (NLC for short) to be the color that has the same “ratio” that exists between the original “light” and “dark” colors:

NLC = LC/DC × NDC

I guess “ratio” doesn't make sense here, but maybe what I'm after is called hue, saturation, or lightness (or any combination of those).

2 Answers 2

1

You could do this in Adobe Illustrator which has HSB and CMYK colour, or perhaps you could use an online tool like Colorizer*. It would also work with HSL which is similar.

Reduce whichever value you want to adjust by a set percentage, and read off the resulting CMYK values.

Here's an example I did in Illustrator using your two colours, then reducing the B component of each by 10%, showing the resulting CMYK values.

enter image description here

*Note: I have no affiliation with the Colorizer website.

1

Short Answer:

Yes, but I don't recommend doing so in CMYK. For meaningful results, you want to use a perceptually uniform model, or at least something close to that. CIELAB is one example, and probably the most accessible, as it is available in Photoshop.

Longer Answer

Color perception, and particularly the perceived distance between two colors, is extremely dependent on context. The surrounding colors on the page, the ambient illumination, and the size of the stimuli in other words the text or the graphical element, all significantly effect the perception.

Readability

If you are talking about the contrast needed for readability, that is primarily related to luminance or lightness contrast. For good readability, we need significant luminance contrast between the text in the background. And this is most especially true at very high spatial frequencies, meaning small thin text.

CIELAB gives useful information regarding color differences for low spatial frequencies, in other words large patches of color. For high spatial frequencies, in other words small thin text or thin lines, there are some other options for determining ideal lightness contrasts.

Readability Contrast Metrics

  • APCA (Accessible Perceptual Contrast Algorithm)—a polarity aware method, weighted for use with self-illuminated monitors.
  • DeltaPhiStar—a general purpose contrast algorithm for text, designed to work with the L* of CIELAB.
    • With 𝜟𝜱✴︎, input the BG and Text L* (Lstar) value:
    dpsContrast = (Math.abs(bgLstar ** 1.618 - txLstar ** 1.618) ** 0.618) * 1.414 - 40 ;
    
    // In JS, ** is exponentiation, so x ** y is equiv to Math.pow(x, y)

That will provide the basic lightness (luminance) contrast value for text.

Hue/Chroma Distances

For finding the hue/chroma that has a similar relationship to the original color pair, you might want to use either the CELAB polar coordinates (LChab, or the OKLAB polar coordinates version. In the polar-coordinates versions, hue is defined as an angle 0°-360°.

However, for CIELAB in particular, the hue circle is not exactly "perceptually uniform". CIECAM02 or CAM16 may give you better results there. However, I am not aware of many tools using these more modern models.

You might also want to look at the Munsell system, and/or the Swedish NCS.

Non-Perceptual Methods

The HSB, HSV, HSL methods are NOT perceptually uniform, and if using those, your results may lack consistency.

Full Disclosures

I created APCA as well as DeltaPhiStar (DPScontrast) and the versions linked to are open source. You might also like to read my article "The Realities and Myths of Contrast and Color" which is written for designers/content authors.

1
  • At a first glance, very interesting! But, sorry, I don't own Photoshop and I don't understand how to use the tools you cite, starting with the CMYK colors that was used in the original LaTeX document and that I mentioned in my OP. Oct 31, 2022 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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