wojtask / clrs4e-solutions

Solutions to exercises and problems from "Introduction to Algorithms", Fourth Edition by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein
Creative Commons Attribution 4.0 International
249 stars 39 forks source link

Configure color palette #1583

Closed wojtask closed 1 year ago

wojtask commented 1 year ago

There are multiple colors used in the book. To keep the solutions consistent, we need to determine these colors by name or RGB and define them in the main file.

wojtask commented 1 year ago

I checked almost all pictures in the book, and grabbed colors from the book's PDF. I came up with a list of most commonly used colors in the book with their HEX, and a short description where they are used. While there are also some other, less frequent colors, in each case they are just slight variations over the regular colors. Therefore, I decided not to include the rarest ones in the solutions palette.

Below is the collected data. I'm presenting them on a screenshot instead of a Markdown table, due to GitHub limitations in support of custom styling in order to show the colors.

image

wojtask commented 1 year ago

I've just learned that the package xcolor produces slightly different shades depending on a color model set. In clrscode4e.sty it's already set to cmyk, so to recreate the extracted colors by their HEX, I have to switch the color model to HTML, by:

\selectcolormodel{HTML}

Then, I can specify the colors using

\definecolor{<colorname>}{HTML}{<HEX>}