texlive[73197] Master/texmf-dist: colorblind (23dec24)
commits+karl at tug.org
commits+karl at tug.org
Mon Dec 23 22:17:51 CET 2024
Revision: 73197
https://tug.org/svn/texlive?view=revision&revision=73197
Author: karl
Date: 2024-12-23 22:17:51 +0100 (Mon, 23 Dec 2024)
Log Message:
-----------
colorblind (23dec24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/colorblind/ChangeLog
trunk/Master/texmf-dist/doc/latex/colorblind/README.md
trunk/Master/texmf-dist/tex/latex/colorblind/colorblind.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.pdf
trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/colorblind/documentation.pdf
trunk/Master/texmf-dist/doc/latex/colorblind/documentation.tex
Modified: trunk/Master/texmf-dist/doc/latex/colorblind/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/colorblind/ChangeLog 2024-12-23 21:17:38 UTC (rev 73196)
+++ trunk/Master/texmf-dist/doc/latex/colorblind/ChangeLog 2024-12-23 21:17:51 UTC (rev 73197)
@@ -1,7 +1,16 @@
Package `colorblind` by Simon Pfahler
-https://github.com/simon-pfahler/colorblind
+https://github.com/simon-pfahler/colorblind/issues
History
=======
+2024/12/23 v1.1
+* Redefine default colors unless the option `keep-defaults` is specified
+* Refactor documentation
+* Minor bug fixes
+
+2024/05/16 v1.0.1
+* Add package options `pgf` and `no-tikz` to give more control over which
+packages are loaded
+
2024/05/12 v1.0
-* First published release.
+* Initial published release
Modified: trunk/Master/texmf-dist/doc/latex/colorblind/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/colorblind/README.md 2024-12-23 21:17:38 UTC (rev 73196)
+++ trunk/Master/texmf-dist/doc/latex/colorblind/README.md 2024-12-23 21:17:51 UTC (rev 73197)
@@ -1,6 +1,6 @@
## Package `colorblind` by Simon Pfahler
-Version 2024-05-12 v1.0
+Version 2024-12-24 v1.1
In colorblind-safe documents, the contents are presented in a way that the same information is conveyed to readers regardless of a potential color vision deficiency.
This package provides the tools necessary for colorblind-safe typesetting in LaTeX.
Added: trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.pdf 2024-12-23 21:17:38 UTC (rev 73196)
+++ trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.pdf 2024-12-23 21:17:51 UTC (rev 73197)
Property changes on: trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.tex 2024-12-23 21:17:51 UTC (rev 73197)
@@ -0,0 +1,422 @@
+%%
+%% ----------------------------------------------------------------
+%% Copyright (C) 2023-2024 by Simon Pfahler <simon.pfahler at ur dot de>
+%% ----------------------------------------------------------------
+%%
+%! TeX program = lualatex
+\DocumentMetadata{lang = en-us}
+\documentclass{scrartcl}
+\usepackage[left=4.5cm,right=3cm,top=3cm,bottom=3cm, marginpar=4cm]{geometry}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{1ex}
+
+\usepackage{xcolor}
+\usepackage{soul}
+
+\usepackage{tikz}
+\usetikzlibrary{positioning, shapes, fit, arrows.meta, decorations.pathmorphing, math}
+\pgfdeclarelayer{bg}
+\pgfsetlayers{bg,main}
+
+\usepackage{pgfplots, pgfplotstable}
+\pgfplotsset{compat=1.18}
+
+%%%% from https://tex.stackexchange.com/questions/355713/pgfplots-show-error-marker-in-legend
+\pgfplotsset{error bar legend/.style={%
+ /pgfplots/legend image code/.prefix code={%
+ \pgfkeysgetvalue{/pgfplots/error bars/error mark}{\pgfplotserrorbarsmark}%
+ \draw[%
+ /pgfplots/every error bar,
+ mark=\pgfplotserrorbarsmark,
+ /pgfplots/error bars/error mark options,
+ sharp plot,
+ ##1
+ ] plot coordinates {(0.3cm, -0.15cm) (0.3cm, 0.15cm)};%
+ }
+ }
+}
+%%%%
+
+\pgfplotsset{custom area legend/.style={%
+ /pgfplots/legend image code/.prefix code={%
+ \fill[##1, draw=white] plot coordinates {(0cm, -0.1cm) (0.6cm,-0.1cm) (0.6cm, 0.1cm) (0cm, 0.1cm)};%
+ }
+ }
+}
+
+\def\w{420pt}
+
+\usepackage{hyperref}
+\hypersetup{
+ pdftitle={Easy colorblind-safe typesetting: the colorblind package},
+ pdfauthor={Simon Pfahler},
+}
+\usepackage{cleveref}
+
+\usepackage{csquotes}
+\usepackage[backend=biber, style=numeric-comp, seconds=true, sorting=none, subentry=true, doi=false, alldates=iso]{biblatex}
+\renewcommand*{\entrysetpunct}{\\[5pt]}
+\addbibresource{bib.bib}
+
+\usepackage[keep-defaults, Tol, OkabeIto, pgf]{colorblind}
+
+\newcommand\colorblind{\textbf{colorblind} }
+\newcommand\hlc[2][T-Q-PH4]{{%
+ \colorlet{foo}{#1}%
+ \sethlcolor{foo}\hl{#2}}%
+}
+
+\reversemarginpar
+\newcommand\marg[1]{\leavevmode\marginpar{\raggedleft #1}}
+\newcommand\tbs{\textbackslash}
+\newcommand\cs[1]{\texttt{\tbs#1}}
+
+\title{Easy colorblind-safe typesetting:\\ the \colorblind package}
+\author{Simon Pfahler}
+\date{\today\\Version 1.1}
+
+
+\begin{document}
+
+\maketitle
+
+\begin{abstract}
+ In colorblind-safe documents, the contents are presented in a way that the same information is conveyed to readers regardless of a potential color vision deficiency.
+ This package provides some useful tools for colorblind-safe typesetting in \LaTeX.
+ It provides color schemes for a wide range of applications.
+ The most commonly used schemes are qualitative schemes, providing easily distinguishable colors for use in graphics, but also for text coloring or highlighting.
+ Additionally, diverging and sequential schemes are provided, which can be used for encoding quantitative information using colors.
+ This package incorporates colorblind-safeness into the writing process, making it both less cumbersome and less error-prone.
+\end{abstract}
+
+\tableofcontents
+\clearpage
+
+\section{Introduction}
+\subsection{For the impatient}
+Writing good colorblind-safe documents can be a tricky task.
+It is a good starting point to realize that the default \LaTeX\ colors like \hlc[red]{red} or \hlc[blue]{blue} should be avoided.
+This is why for the impatient, simply loading this package without specifying any options (i.e.\ \cs{usepackage\{colorblind\}}) redefines the default colors to more sensible alternatives.
+\footnote{Where no suitable redefinition was possible for a builtin named color, the definition is changed to black.}
+
+\begin{figure}[ht]
+ \centering
+ \begin{tikzpicture}
+ \node[inner sep=1, fill=red] at (-1.2*0.7cm,2.3*0.7cm) {R};
+ \node[inner sep=1, fill=green] at (-1.2*0.7cm, 1.8*0.7cm) {G};
+ \node[inner sep=1, fill=blue] at (-1.2*0.7cm,1.3*0.7cm) {B};
+
+ \node at (1*1cm-1cm,2.3*0.7cm) {68};
+ \node at (1*1cm-1cm,1.8*0.7cm) {119};
+ \node at (1*1cm-1cm,1.3*0.7cm) {170};
+ \draw[fill=T-Q-B1] (1*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (1*1cm-1cm,-1*0.7cm) {\vphantom{bp}blue};
+
+ \node at (2*1cm-1cm,2.3*0.7cm) {102};
+ \node at (2*1cm-1cm,1.8*0.7cm) {204};
+ \node at (2*1cm-1cm,1.3*0.7cm) {238};
+ \draw[fill=T-Q-B2] (2*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (2*1cm-1cm,-1*0.7cm) {\vphantom{bp}cyan};
+
+ \node at (3*1cm-1cm,2.3*0.7cm) {34};
+ \node at (3*1cm-1cm,1.8*0.7cm) {136};
+ \node at (3*1cm-1cm,1.3*0.7cm) {51};
+ \draw[fill=T-Q-B3] (3*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (3*1cm-1cm,-1*0.7cm) {\vphantom{bp}green};
+
+ \node at (4*1cm-1cm,2.3*0.7cm) {204};
+ \node at (4*1cm-1cm,1.8*0.7cm) {187};
+ \node at (4*1cm-1cm,1.3*0.7cm) {68};
+ \draw[fill=T-Q-B4] (4*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (4*1cm-1cm,-1*0.7cm) {\vphantom{bp}yellow};
+
+ \node at (5*1cm-1cm,2.3*0.7cm) {238};
+ \node at (5*1cm-1cm,1.8*0.7cm) {102};
+ \node at (5*1cm-1cm,1.3*0.7cm) {119};
+ \draw[fill=T-Q-B5] (5*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (5*1cm-1cm,-1*0.7cm) {\vphantom{bp}red};
+
+ \node at (6*1cm-1cm,2.3*0.7cm) {170};
+ \node at (6*1cm-1cm,1.8*0.7cm) {51};
+ \node at (6*1cm-1cm,1.3*0.7cm) {119};
+ \draw[fill=T-Q-B6] (6*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (6*1cm-1cm,-1*0.7cm) {\vphantom{bp}violet};
+
+ \node at (7*1cm-1cm,2.3*0.7cm) {187};
+ \node at (7*1cm-1cm,1.8*0.7cm) {187};
+ \node at (7*1cm-1cm,1.3*0.7cm) {187};
+ \draw[fill=T-Q-B0] (7*1cm-1cm,0) circle (0.7cm);
+ \node[rotate=25, anchor=north east] at (7*1cm-1cm,-1*0.7cm) {\vphantom{bp}gray};
+
+ \end{tikzpicture}
+ \caption{Redefinitions of the default \LaTeX\ colors.}
+\end{figure}
+
+It should be noted that this is a very brute-force way of trying to achieve colorblind-safeness.
+If you care about this topic (which you should), the rest of this document provides details on how colorblind-safeness is best achieved in different scenarios.
+
+\subsection{Package options}
+\marg{\texttt{Tol}\\\texttt{OkabeIto}}%
+The \colorblind package provides the color schemes by Paul Tol~\cite{Tol} and the Okabe Ito color palette~\cite{Ichihara_2008}.
+By default, no schemes are loaded.
+Providing one of the options \texttt{Tol} or \texttt{OkabeIto} loads all corresponding schemes.
+
+\marg{\texttt{pgf}}%
+If the option \texttt{pgf} is provided, continuous colormaps are defined for use with \texttt{pgfplots} (or \texttt{TikZ}).
+Also, the command \cs{drawSchemeC} for drawing continuous color schemes is only defined when the option is provided and continuous color schemes are available (through providing the \texttt{Tol} option).
+Continuous versions of color schemes are only available when the colors are allowed to be interpolated, see below for details.
+
+\marg{\texttt{no-tikz}}%
+The package uses \texttt{TikZ} to draw the discrete versions of color schemes.
+Providing the option \texttt{no-tikz} disables this, the command \cs{drawScheme} is not defined in this case.
+
+\marg{\texttt{keep-defaults}}%
+The package redefines the default colors like \hlc[T-Q-PH5]{red} or \hlc[T-Q-PH1]{blue} to be colorblind-safe. By specifying this option, the defaults are not changed.
+
+\subsection{Overview}
+As an example for how to use the colors, we look at the \emph{bright qualitative} color scheme by Tol.
+\cref{fig:T-Q-Bexample} shows the colors in the scheme.
+
+\begin{figure}[ht]
+ \centering
+ \drawScheme{T-Q-B}
+ \caption{Bright qualitative color scheme by Tol.}
+ \label{fig:T-Q-Bexample}
+\end{figure}
+
+All colors in this model start with \texttt{T-Q-B}, indicating that it is a scheme by \textbf{T}ol, that it is a \textbf{q}ualitative scheme, and that it is the \textbf{b}right scheme.
+The colors in the scheme are specified by a number following the scheme name, in this case ranging from \texttt{T-Q-B1} to \texttt{T-Q-B6} for the non-grey colors.
+The additional color \texttt{T-Q-B0} provides a color that can be used, e.g., to indicate bad data.
+
+There are two reasons why color names are not based on natural color names (e.g., ``\hlc[T-Q-PH1]{blue}''):
+\begin{enumerate}
+ \item Certain colors (\hlc[T-Q-PH3]{green}, \hlc[T-Q-PH5]{red}) are often used by people with full color vision to convey certain meanings (\hlc[T-Q-PH3]{good}, \hlc[T-Q-PH5]{bad}).
+ This meaning is difficult for people with color vision deficiencies to pick up.
+ By not using natural color names, it is easier to write colorblind-safe documents that do not make use of said connotations.
+ \item Natural color names can be cumbersome, e.g., when slight variations of a color are used. It is annoying having to look up if a color is called, e.g., \hlc[T-Q-PH1]{blue} or \hlc[T-Q-PH2]{cyan}.
+\end{enumerate}
+
+These colors are used the same way as any other colors. To change the text color to \texttt{T-Q-B1} for example, use \cs{color\{T-Q-B1\}}.
+
+\section{Guidelines}\label{sec:guidelines}
+In this section, we provide some general guidelines for colorblind-safe design.
+
+Color vision deficiencies apper in many different variations and grades of severity, up to monochromacy, where different colors can only be distinguished via their perceived brightness.
+This means that while the color schemes provided by this package are easier to distinguish for the most common color vision deficiencies, information encoded only in color can never be truely colorblind safe.
+This leads us to the most important rule in colorblind-safe design:
+\begin{center}
+ \setlength{\fboxrule}{1pt}
+ \textbf{Rule 1}:
+ \fbox{\parbox{0.65\columnwidth}{
+ Always provide information in more ways than just color.
+ }}
+\end{center}
+
+If this rule is satisfied in a document, it is by construction guaranteed to be colorblind-safe.
+However, this does not mean that it is \emph{convenient} for people with color vision deficiencies to extract the information.
+In order to achieve the best possible result, a few more rules should be considered when using color.
+\begin{center}
+ \setlength{\fboxrule}{1pt}
+ \textbf{Rule 2}:
+ \fbox{\parbox{0.65\columnwidth}{
+ Stick to a color scheme.
+ \begin{itemize}
+ \item[(\textbf{a})] Do not mix colors within a scheme.
+ \item[(\textbf{b})] Do not use shades of colors.
+ \end{itemize}
+ }}
+\end{center}
+
+Colors within colorblind-safe color schemes are designed to be eaily distinguishable for people with the most common color vision deficiencies, so we should only use colors from one color scheme in any given visual unit.
+In extension, even colors from the same scheme should not be mixed, since this makes it harder to distinguish them.
+Even if the result of the mixing is easily distinguishable for people with normal color vision, the same might not be true under certain color vision deficiencies.
+For the same reaseon, shades of colors (i.e.\ mixings with black or white) should be avoided, because the brightness of colors is also used to make sure the colors are distinguishable.
+
+\begin{center}
+ \setlength{\fboxrule}{1pt}
+ \textbf{Rule 3}:
+ \fbox{\parbox{0.65\columnwidth}{
+ Do not use color for information and aesthetics simultaneously.
+ }}
+\end{center}
+
+Color is often also used for aesthetic reasons, e.g., on a scientific poster.
+This is usually unproblematic, as the color does not convey information in this case.
+However, if color is used to convey information in a visual unit, avoid using additional color for aesthetic purposes, as this makes it more difficult to extract the information encoded in the color.
+
+\begin{center}
+ \setlength{\fboxrule}{1pt}
+ \textbf{Rule 4}:
+ \fbox{\parbox{0.65\columnwidth}{
+ Do not use rainbow color schemes.
+ }}
+\end{center}
+
+Due to the many different colors in a rainbow color scheme, they are inevitably difficult to distinguish for people with color vision deficiencies.
+Therefore, it is best to avoid them.
+If a rainbow color scheme has to be used at all cost, Paul Tol (and thus also the \texttt{colorblind} package) provides both a discrete as well as a continuous version~\cite{Tol}, which are optimized to be as distinguishable as possible.
+
+By following these four simple rules, we can ensure that the information encoded in a document is presented in a colorblind-safe way, and that it is reasonably convenient for people affected by color vision deficiencies to extract the information.
+As a side node, following these rules leads to documents that do not suffer from information loss when printed in black and white, which is usually also desirable.
+
+\section{Provided color schemes}\label{sec:colors}
+The color schemes provided are split into three groups:
+\begin{itemize}
+ \item Qualitative schemes:\newline
+ These schemes are used to convey qualitative information, such as different data sources, countries or manufacturers.
+ They should usually be used for coloring text or distinguishing different lines/bars in a plot.
+ \item Diverging color schemes:\newline
+ When quantitative data ranges between two extremes, and the middle is being considered ``neutral'', a diverging color scheme should be used.
+ Examples for this kind of data might be test grades, temperatures or pH values.
+ \item Sequential color schemes:\newline
+ For quantitative data without an important midpoint, sequential color schemes should be preferred over diverging ones.
+ This is especially true for quantites that start from $0$.
+ They can be used to denote for example velocities, concentrations or pressures.
+\end{itemize}
+
+For each type of schemes, this package provides a range of options.
+\Cref{sec:Tol_schemes} shows the schemes designed by Paul Tol~\cite{Tol}, which include qualitative, diverging and sequential schemes (see \cref{sec:T-Q,sec:T-D,sec:T-S}).
+In \cref{sec:OkabeIto}, the Okabe Ito color scheme~\cite{Ichihara_2008} is provided, which is probably the most famous qualitative colorblind-safe color scheme due to it being mentioned in various articles in high-ranking journals.
+
+All of the schemes are colorblind-safe, and some are optimized for printout or designed for a particular purpose.
+This is denoted under the scheme name.\clearpage
+
+\subsection{Paul Tol's color schemes}\label{sec:Tol_schemes}
+
+\subsubsection{Qualitative color schemes}\label{sec:T-Q}
+\begin{minipage}{0.5\textwidth}
+ \centering
+ \scalebox{0.7}{\drawScheme{T-Q-B}}\\
+ \textbf{B}right\\
+ \phantom{pb}
+\end{minipage}\hfill%
+\begin{minipage}{0.5\textwidth}
+ \centering
+ \scalebox{0.7}{\drawScheme{T-Q-V}}\\
+ \textbf{V}ibrant
+\end{minipage}
+
+\begin{minipage}{0.5\textwidth}
+ \centering
+ \scalebox{0.7}{\drawScheme{T-Q-HC}}\\
+ \textbf{H}igh-\textbf{C}ontrast\\
+ works for black and white printout
+\end{minipage}\hfill%
+\begin{minipage}{0.5\textwidth}
+ \centering
+ \scalebox{0.7}{\drawScheme{T-Q-MC}}\\
+ \textbf{M}edium-\textbf{C}ontrast\\
+ works for black and white printout
+\end{minipage}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-Q-M}}\\
+ \textbf{M}uted
+\end{center}
+
+\begin{minipage}{0.5\textwidth}
+ \centering
+ \scalebox{0.7}{\drawScheme{T-Q-PH}}\\
+ \textbf{P}ale \textbf{H}ighlight\\
+ specifically for text background
+\end{minipage}\hfill%
+\begin{minipage}{0.5\textwidth}
+ \centering
+ \scalebox{0.7}{\drawScheme{T-Q-DT}}\\
+ \textbf{D}ark \textbf{T}ext\\
+ specifically for text color
+\end{minipage}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-Q-L}}\\
+ \textbf{L}ight\\
+ less distinguishable than other schemes,\\ mostly meant for filling in labelled cells
+\end{center}\clearpage
+
+\subsubsection{Diverging color schemes}\label{sec:T-D}
+For diverging schemes, when a continuous scheme is needed, the colors are allowed to be linearly interpolated.
+When using the option \texttt{pgf}, the interpolations are available as colormaps with the names of their color scheme.
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-D-S}}\\
+ \drawSchemeC[0.6\textwidth]{T-D-S}\\
+ \textbf{S}unset
+\end{center}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-D-N}}\\
+ \drawSchemeC[0.9\textwidth]{T-D-N}\\
+ \textbf{N}ightfall
+\end{center}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-D-BR}}\\
+ \drawSchemeC[0.5\textwidth]{T-D-BR}\\
+ \textbf{B}u\textbf{R}d
+\end{center}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-D-PG}}\\
+ \drawSchemeC[0.5\textwidth]{T-D-PG}\\
+ \textbf{P}R\textbf{G}n
+\end{center}\clearpage
+
+\subsubsection{Sequential color schemes}\label{sec:T-S}
+For most sequential schemes, a continuous scheme can be obtained again by linearly interpolating the colors.
+The only exception to this is the \emph{discrete rainbow} scheme, which has an explicitly continuos variation, the \emph{smooth rainbow} scheme.
+When using the option \texttt{pgf}, the interpolations are available as colormaps with the names of their color scheme.
+
+When the discrete scheme is not shown, this is because there are too many colors in it.
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-S-YOB}}\\
+ \drawSchemeC[0.5\textwidth]{T-S-YOB}\\
+ \textbf{Y}l\textbf{O}r\textbf{B}r
+\end{center}
+
+\begin{center}
+ \drawSchemeC[0.9\textwidth]{T-S-IR}\\
+ \textbf{Ir}idescent
+\end{center}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-S-IN}}\\
+ \drawSchemeC[0.6\textwidth]{T-S-IN}\\
+ \textbf{In}candescent\\
+ not print-friendly
+\end{center}
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{T-S-DR}}\\
+ \textbf{D}iscrete \textbf{R}ainbow\\
+ Do not interpolate!
+\end{center}
+
+\begin{center}
+ \drawSchemeC[\textwidth]{T-S-SR}\\
+ \textbf{S}mooth \textbf{R}ainbow\\
+\end{center}\clearpage
+
+\subsection{Okabe Ito qualitative color scheme}\label{sec:OkabeIto}
+This is the qualitative color scheme commonly known as the \emph{Okabe Ito} color palette~\cite{Ichihara_2008}.
+
+\begin{center}
+ \scalebox{0.7}{\drawScheme{OI}}\\
+ \textbf{O}kabe \textbf{I}to
+\end{center}
+
+\section{Provided commands}
+\marg{\cs{drawScheme\{...\}}}%
+The discrete visualizations of color schemes given in this documentation are created with the command \cs{drawScheme\{...\}}.
+The name of the color scheme should be provided to the command, e.g.\ \cs{drawScheme\{T-Q-B\}} to print the \emph{qualitative bright} scheme by Tol.
+Note that this command is not available when the package option \texttt{no-tikz} is used.
+
+\marg{\cs{drawSchemeC\{...\}}}%
+The continuous visualizations of color schemes given in this documentation are created with the command \cs{drawSchemeC\{...\}}.
+The name of the color scheme should be provided to the command, e.g.\ \cs{drawSchemeC\{T-D-S\}} to print the \emph{diverging sunset} scheme by Tol.
+Note that this command only works for color schemes that are allowed to be interpolated, and that the command is only available when the package option \texttt{pgf} is used.
+
+\clearpage
+\printbibliography
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/colorblind/colorblind_doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/colorblind/documentation.pdf
===================================================================
(Binary files differ)
Deleted: trunk/Master/texmf-dist/doc/latex/colorblind/documentation.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/colorblind/documentation.tex 2024-12-23 21:17:38 UTC (rev 73196)
+++ trunk/Master/texmf-dist/doc/latex/colorblind/documentation.tex 2024-12-23 21:17:51 UTC (rev 73197)
@@ -1,365 +0,0 @@
-%%
-%% ----------------------------------------------------------------
-%% Copyright (C) 2023-2024 by Simon Pfahler <simon.pfahler at ur dot de>
-%% ----------------------------------------------------------------
-%%
-%! TeX program = lualatex
-\documentclass{scrartcl}
-\usepackage[left=4cm,right=3cm,top=3cm,bottom=3cm, marginpar=3cm]{geometry}
-\setlength{\parindent}{0pt}
-\setlength{\parskip}{1ex}
-
-\usepackage{cprotect}
-\usepackage{tikz}
-\usetikzlibrary{math}
-
-\usepackage{xcolor}
-\usepackage{soul}
-
-\usepackage{tikz}
-\usetikzlibrary{positioning, shapes, fit, arrows.meta, decorations.pathmorphing}
-\pgfdeclarelayer{bg}
-\pgfsetlayers{bg,main}
-
-\usepackage{pgfplots, pgfplotstable}
-\pgfplotsset{compat=1.18}
-
-%%%% from https://tex.stackexchange.com/questions/355713/pgfplots-show-error-marker-in-legend
-\pgfplotsset{error bar legend/.style={%
- /pgfplots/legend image code/.prefix code={%
- \pgfkeysgetvalue{/pgfplots/error bars/error mark}{\pgfplotserrorbarsmark}%
- \draw[%
- /pgfplots/every error bar,
- mark=\pgfplotserrorbarsmark,
- /pgfplots/error bars/error mark options,
- sharp plot,
- ##1
- ] plot coordinates {(0.3cm, -0.15cm) (0.3cm, 0.15cm)};%
- }
- }
-}
-%%%%
-
-\pgfplotsset{custom area legend/.style={%
- /pgfplots/legend image code/.prefix code={%
- \fill[##1, draw=white] plot coordinates {(0cm, -0.1cm) (0.6cm,-0.1cm) (0.6cm, 0.1cm) (0cm, 0.1cm)};%
- }
- }
-}
-
-\def\w{420pt}
-
-\usepackage{hyperref}
-\hypersetup{
- pdftitle={Easy colorblind-safe typesetting: the colorblind package},
- pdfauthor={Simon Pfahler},
-}
-\usepackage{cleveref}
-
-\usepackage{csquotes}
-\usepackage[backend=biber, style=numeric-comp, seconds=true, sorting=none, subentry=true, doi=false, alldates=iso]{biblatex}
-\renewcommand*{\entrysetpunct}{\\[5pt]}
-\addbibresource{bib.bib}
-
-\usepackage[Tol, OkabeIto]{colorblind}
-
-\newcommand\colorblind{\textbf{colorblind} }
-\newcommand\hlc[2][T-Q-PH4]{{%
- \colorlet{foo}{#1}%
- \sethlcolor{foo}\hl{#2}}%
-}
-
-\reversemarginpar
-\newcommand\marg[1]{\leavevmode\marginpar{\raggedleft #1}}
-\newcommand\tbs{\textbackslash}
-
-\title{Easy colorblind-safe typesetting:\\ the \colorblind package}
-\author{Simon Pfahler}
-\date{\today\\Version 1.0}
-
-
-\begin{document}
-
-\maketitle
-
-\begin{abstract}
- In colorblind-safe documents, the contents are presented in a way that the same information is conveyed to readers regardless of a potential color vision deficiency.
- This package provides the tools necessary for colorblind-safe typesetting in \LaTeX.
- It provides color schemes for a wide range of applications.
- The most commonly used schemes are qualitative schemes, providing easily distinguishable colors for use in graphics, but also for text coloring or highlighting.
- Additionally, diverging and sequential schemes are included which can be used for encoding quantitative information using colors.
- This package incorporates colorblind-safeness into the writing process, making it both less cumbersome and less error-prone.
-\end{abstract}
-
-\tableofcontents
-\clearpage
-
-\section{Introduction}
-\subsection{Package options}
-\cprotect\marg{\verb!Tol!\\\verb!OkabeIto!}%
-The \colorblind package provides the color schemes by Paul Tol~\cite{Tol} and the Okabe Ito color palette~\cite{Ichihara_2008}.
-By default, no schemes are loaded.
-Providing one of the options \verb!Tol! or \verb!OkabeIto! loads all corresponding schemes.
-
-\subsection{Overview}
-As an example for how to use the colors, we look at the \emph{bright qualitative} color scheme by Tol.
-\cref{fig:T-Q-Bexample} shows the colors in the scheme
-
-\begin{figure}[ht]
- \centering
- \drawScheme{T-Q-B}
- \caption{Bright qualitative color scheme by Tol.}
- \label{fig:T-Q-Bexample}
-\end{figure}
-
-All colors in this model start with \verb!T-Q-B!, indicating that it is a scheme by \textbf{T}ol, that it is a \textbf{q}ualitative scheme, and that it is the \textbf{b}right scheme.
-The colors in the scheme are specified by a number following the scheme name, in this case ranging from \verb!T-Q-B1! to \verb!T-Q-B6! for the non-grey colors.
-The additional color \verb!T-Q-B0! provides a color that can be used, e.g., to indicate bad data.
-
-There are two reasons why color names are not based on natural color names (e.g., ``\hlc[T-Q-PH1]{blue}''):
-\begin{enumerate}
- \item Certain colors (\hlc[T-Q-PH3]{green}, \hlc[T-Q-PH5]{red}) are often used by people with full color vision to convey certain meanings (\hlc[T-Q-PH3]{good}, \hlc[T-Q-PH5]{bad}).
- This meaning is difficult for people with color vision deficiencies to pick up.
- By not using natural color names, it is easier to write colorblind-safe documents that do not make use of said connotations.
- \item Natural color names can be cumbersome, e.g., when multiple variations of a primary color are used. It is annoying having to look up if a color is called, e.g., \hlc[T-Q-PH1]{blue} or \hlc[T-Q-PH2]{cyan}.
-\end{enumerate}
-
-These colors are used the same way as any other colors. To change the text color to \verb!T-Q-B1! for example, use \verb!\color{T-Q-B1}!.
-
-\section{Guidelines}
-On its own, using colorblind-safe colors is not sufficient for making a document truly colorblind-safe.
-This section provides some general rules to follow for colorblind-safe typesetting.
-
-These rules apply to each visual unit of a document individually.
-A visual unit may be a graphic, a table or a paragraph of text.
-It might be advisable to be consistent also between different visual units (e.g., use the same color scheme for all graphics), but this is more of an aesthetic argument and is not strictly necessary for a colorblind-safe document.
-
-The most important rules are:
-\begin{enumerate}
- \item \hlc{Do not mix the colors in qualitative schemes!}\newline
- The colors in each scheme are defined with the purpose of being easily distinguishable.
- Mixing of colors, e.g., \verb?T-Q-B1!50!T-Q-B5? interferes with this.
- A special case of this is that qualitative colors should not be mixed in order to convey quantitative information.
- In this case, a suitable non-qualitative color scheme (i.e.\ a diverging or sequential scheme) should be used.
- \item \hlc{Only use colors from one color scheme for a given visual unit!}\newline
- The colors between different schemes are not tuned to be distinguishable.
- Using colors from multiple schemes therefore defies the point of this package.
- \item \hlc{Do not use shades of colors!}\newline
- Saturation and brightness are also used for distinguishability, so mixings involving \verb!white! and \verb!black! should also be avoided.
-\end{enumerate}
-
-The first two rules should be ensured in any visual unit. If the need for more colors arises, a different color scheme should be used alltogether.
-While the third rule should also be followed in most scenarios, there are some situations that might allow for breaking this rule. As an example, consider \cref{fig:errorbar_plot}, where the error band is colored with a lighter shade of the original color.
-This is ok because only few colors are used in the plot and the colors are not necessary for conveying the message of the plot.
-
-\begin{figure}[ht]
- \centering
- \begin{tikzpicture}
- \begin{axis}[
- width=0.4*\w,
- height=0.28*\w,
- scale only axis=true,
- xlabel = {x},
- ylabel = {y},
- x label style = {yshift=2mm},
- y label style = {yshift=-2mm},
- clip marker paths=true,
- axis on top
- ]
-
- \fill[T-Q-B5!20] (0,0.1068558) -- (40,0.1068558) -- (40,0.0668558) -- (0,0.0668558) -- cycle;
- \draw[T-Q-B5] (0,0.0868558) -- (40,0.0868558);
-
- \addplot[color=T-Q-B1, mark=*, only marks, forget plot]
- plot[/pgfplots/error bars/.cd, x dir=none, y dir=both, y explicit,
- error mark=-, error bar style={color=T-Q-B1}]
- coordinates {
- (4,0.263148) +- (0.120064,0.120064)
- (8,0.159158) +- (0.0621894,0.0621894)
- (12,0.129892) +- (0.0543303,0.0543303)
- (16,0.112302) +- (0.0358508,0.0358508)
- (20,0.098435) +- (0.02648,0.02648)
- (24,0.0909784) +- (0.0215048,0.0215048)
- (28,0.0894657) +- (0.0212992,0.0212992)
- (32,0.0869343) +- (0.0202553,0.0202553)
- };
- \addlegendimage{T-Q-B1, mark=*, only marks, error bar legend};
- \addlegendentry{data};
- \addlegendimage{draw=T-Q-B5, fill=T-Q-B5!20, custom area legend};
- \addlegendentry{reference};
-
- \end{axis}
- \end{tikzpicture}
- \cprotect\caption{This plot breaks rule 3 by using the shade \verb?T-Q-B5!20? for the error band of the reference, but it is still colorblind-safe.}
- \label{fig:errorbar_plot}
-\end{figure}
-
-There are additional guidelines that should be kept in mind when typesetting colorblind-safe documents.
-Their importance may vary between different applications, so try to follow them as best as possible, at your own judgement.
-In no particular order, they are:
-\begin{itemize}
- \item \hlc{Do not convey information only through color!}\newline
- When possible, encode the information the color provides also in a different way, e.g., through text, patterns or symbols.
- \item \hlc{Do not use color for information and aesthetics simultaneously!}\newline
- Color is often also used for aesthetic reasons, e.g., on a scientific poster.
- While this is ok in principle, do not mix information and aesthetics within the same visual unit, as this makes it more difficult to extract the encoded information.
- \item \hlc{Do not use rainbow color schemes!}\newline
- Due to the many different colors in a rainbow color scheme, they are very difficult to distinguish for people with color vision deficiencies (even when the scheme is tuned for this purpose).
- Therefore, it is best to avoid them.
- If you insist on using them, Paul Tol provides both a sequential as well as a continuous version, which are optimized to be as distinguishable as possible.
-\end{itemize}
-
-\section{Provided color schemes}\label{sec:colors}
-The color schemes provided are split into three groups:
-\begin{itemize}
- \item Qualitative schemes:\newline
- These schemes are used to convey qualitative information, such as different data sources, countries or manufacturers.
- They should usually be used for coloring text or distinguishing different lines/bars in a plot.
- \item Diverging color schemes:\newline
- When quantitative data ranges between two extremes, and the middle is being considered ``neutral'', a diverging color scheme should be used.
- Examples for this kind of data might be test grades, temperatures or pH values.
- \item Sequential color schemes:\newline
- For quantitative data without an important midpoint, sequential color schemes should be preferred over diverging ones.
- This is especially true for quantites that start from $0$.
- They can be used to denote for example velocities, concentrations or pressures.
-\end{itemize}
-
-For each type of schemes, this package provides a range of options.
-\Cref{sec:Tol_schemes} shows the schemes designed by Paul Tol~\cite{Tol}, which include qualitative, diverging and sequential schemes (see \cref{sec:T-Q,sec:T-D,sec:T-S}).
-In \cref{sec:OkabeIto}, the Okabe Ito color scheme~\cite{Ichihara_2008} is provided, which is probably the most famous qualitative colorblind-safe color scheme due to it being mentioned in various articles in high-ranking journals.
-
-All of the schemes are colorblind-safe, and some are optimized for printout or designed for a particular purpose.
-This is denoted under the scheme name.\clearpage
-
-\subsection{Paul Tol's color schemes}\label{sec:Tol_schemes}
-
-\subsubsection{Qualitative color schemes}\label{sec:T-Q}
-\begin{minipage}{0.5\textwidth}
- \centering
- \scalebox{0.7}{\drawScheme{T-Q-B}}\\
- \textbf{B}right\\
- \phantom{pb}
-\end{minipage}\hfill%
-\begin{minipage}{0.5\textwidth}
- \centering
- \scalebox{0.7}{\drawScheme{T-Q-V}}\\
- \textbf{V}ibrant
-\end{minipage}
-
-\begin{minipage}{0.5\textwidth}
- \centering
- \scalebox{0.7}{\drawScheme{T-Q-HC}}\\
- \textbf{H}igh-\textbf{C}ontrast\\
- works for black and white printout
-\end{minipage}\hfill%
-\begin{minipage}{0.5\textwidth}
- \centering
- \scalebox{0.7}{\drawScheme{T-Q-MC}}\\
- \textbf{M}edium-\textbf{C}ontrast\\
- works for black and white printout
-\end{minipage}
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-Q-M}}\\
- \textbf{M}uted
-\end{center}
-
-\begin{minipage}{0.5\textwidth}
- \centering
- \scalebox{0.7}{\drawScheme{T-Q-PH}}\\
- \textbf{P}ale \textbf{H}ighlight\\
- specifically for text background
-\end{minipage}\hfill%
-\begin{minipage}{0.5\textwidth}
- \centering
- \scalebox{0.7}{\drawScheme{T-Q-DT}}\\
- \textbf{D}ark \textbf{T}ext\\
- specifically for text color
-\end{minipage}
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-Q-L}}\\
- \textbf{L}ight\\
- less distinguishable than other schemes,\\ mostly meant for filling in labelled cells
-\end{center}\clearpage
-
-\subsubsection{Diverging color schemes}\label{sec:T-D}
-For diverging schemes, when a continuous palette is needed, the colors are allowed to be linearly interpolated.
-When using \verb!pgfplots! (or \verb!TikZ!), the interpolations are available as colormaps with the names of their color scheme.
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-D-S}}\\
- \drawSchemeC[0.6\textwidth]{T-D-S}\\
- \textbf{S}unset
-\end{center}
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-D-N}}\\
- \drawSchemeC[0.9\textwidth]{T-D-N}\\
- \textbf{N}ightfall
-\end{center}
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-D-BR}}\\
- \drawSchemeC[0.5\textwidth]{T-D-BR}\\
- \textbf{B}u\textbf{R}d
-\end{center}\clearpage
-
-\subsubsection{Sequential color schemes}\label{sec:T-S}
-For most sequential schemes, a continuous palette can be obtained again by linearly interpolating the colors.
-The only exception to this is the \emph{discrete rainbow} scheme, which has an explicitly continuos variation, the \emph{smooth rainbow} scheme.
-When using \verb!pgfplots!, the interpolations are available as colormaps with the names of their color scheme.
-
-When the discrete scheme is not shown, this is because there are too many colors in them.
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-S-YOB}}\\
- \drawSchemeC[0.5\textwidth]{T-S-YOB}\\
- \textbf{Y}l\textbf{O}r\textbf{B}r
-\end{center}
-
-\begin{center}
- \drawSchemeC[0.9\textwidth]{T-S-IR}\\
- \textbf{Ir}idescent
-\end{center}
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-S-IN}}\\
- \drawSchemeC[0.6\textwidth]{T-S-IN}\\
- \textbf{In}candescent\\
- not print-friendly
-\end{center}
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{T-S-DR}}\\
- \textbf{D}iscrete \textbf{R}ainbow\\
- Do not interpolate!
-\end{center}
-
-\begin{center}
- \drawSchemeC[\textwidth]{T-S-SR}\\
- \textbf{S}mooth \textbf{R}ainbow\\
-\end{center}
-
-\subsection{Okabe Ito qualitative color scheme}\label{sec:OkabeIto}
-This is the qualitative color scheme commonly known as the \emph{Okabe Ito} color palette~\cite{Ichihara_2008}.
-
-\begin{center}
- \scalebox{0.7}{\drawScheme{OI}}\\
- \textbf{O}kabe \textbf{I}to
-\end{center}
-
-\section{Provided commands}
-\cprotect\marg{\verb!\drawScheme{...}!}%
-The discrete visualizations of color schemes given in this documentation are created with the command \verb!\drawScheme{...}!.
-The name of the color scheme should be provided to the command, e.g.\ \verb!\drawScheme{T-Q-B}! to print the \emph{qualitative bright} scheme by Tol.
-
-\cprotect\marg{\verb!\drawSchemeC{...}!}%
-The continuous visualizations of color schemes given in this documentation are created with the command \verb!\drawSchemeC{...}!.
-The name of the color scheme should be provided to the command, e.g.\ \verb!\drawSchemeC{T-D-S}! to print the \emph{diverging sunset} scheme by Tol.
-Note that this command only works for color schemes that are allowed to be interpolated.
-
-\clearpage
-\printbibliography
-
-\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/colorblind/colorblind.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/colorblind/colorblind.sty 2024-12-23 21:17:38 UTC (rev 73196)
+++ trunk/Master/texmf-dist/tex/latex/colorblind/colorblind.sty 2024-12-23 21:17:51 UTC (rev 73197)
@@ -4,395 +4,458 @@
%% ----------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{colorblind}[2024/05/12 Easy colorblind-safe typesetting]
+\ProvidesPackage{colorblind}[2024/12/23 Easy colorblind-safe typesetting]
\RequirePackage{xcolor}
\RequirePackage{ifthen}
-\RequirePackage{tikz}
-\usetikzlibrary{math}
-\RequirePackage{pgfplots}
-\pgfplotsset{compat=1.18}
-\DeclareOption{Tol}{
-%>>> Color schemes by Paul Tol, source: https://personal.sron.nl/~pault
-%
-%>>> Qualitative color schemes
-%
-% Bright Qualitative color scheme
-\providecolorset{RGB}{T-Q-B}{}{%
- 1,68,119,170;%
- 2,102,204,238;%
- 3,34,136,51;%
- 4,204,187,68;%
- 5,238,102,119;%
- 6,170,51,119;%
- 0,187,187,187%
+\newif\iftikz
+\tikztrue
+\DeclareOption{no-tikz}{
+ \tikzfalse
}
-%
-% High-contrast qualitative color scheme
-\providecolorset{RGB}{T-Q-HC}{}{%
- 1,255,255,255;%
- 2,221,170,51;%
- 3,187,85,102;%
- 4,0,68,136;%
- 0,0,0,0%
+
+\newif\ifpgf
+\pgffalse
+\DeclareOption{pgf}{
+ \pgftrue
}
-%
-% Vibrant qualitative color scheme
-\providecolorset{RGB}{T-Q-V}{}{%
- 1,0,119,187;%
- 2,51,187,238;%
- 3,0,153,136;%
- 4,238,119,51;%
- 5,204,51,17;%
- 6,238,51,119;%
- 0,187,187,187%
+
+\newif\ifredefinedefaults
+\redefinedefaultstrue
+\DeclareOption{keep-defaults}{
+ \redefinedefaultsfalse
}
-%
-% Muted qualitative color scheme
-\providecolorset{RGB}{T-Q-M}{}{%
- 1,51,34,136;%
- 2,136,204,238;%
- 3,68,170,153;%
- 4,153,153,51;%
- 5,221,204,119;%
- 6,204,102,119;%
- 7,136,34,85;%
- 8,170,68,153;%
- 0,221,221,221%
+
+\newif\ifTolColors
+\TolColorsfalse
+\DeclareOption{Tol}{
+ \TolColorstrue
+ %>>> Color schemes by Paul Tol, source: https://personal.sron.nl/~pault
+ %
+ %>>> Qualitative color schemes
+ %
+ % Bright Qualitative color scheme
+ \providecolorset{RGB}{T-Q-B}{}{%
+ 1,68,119,170;%
+ 2,102,204,238;%
+ 3,34,136,51;%
+ 4,204,187,68;%
+ 5,238,102,119;%
+ 6,170,51,119;%
+ 0,187,187,187%
+ }
+ %
+ % High-contrast qualitative color scheme
+ \providecolorset{RGB}{T-Q-HC}{}{%
+ 1,255,255,255;%
+ 2,221,170,51;%
+ 3,187,85,102;%
+ 4,0,68,136;%
+ 0,0,0,0%
+ }
+ %
+ % Vibrant qualitative color scheme
+ \providecolorset{RGB}{T-Q-V}{}{%
+ 1,0,119,187;%
+ 2,51,187,238;%
+ 3,0,153,136;%
+ 4,238,119,51;%
+ 5,204,51,17;%
+ 6,238,51,119;%
+ 0,187,187,187%
+ }
+ %
+ % Muted qualitative color scheme
+ \providecolorset{RGB}{T-Q-M}{}{%
+ 1,51,34,136;%
+ 2,136,204,238;%
+ 3,68,170,153;%
+ 4,17,119,51;%
+ 5,153,153,51;%
+ 6,221,204,119;%
+ 7,204,102,119;%
+ 8,136,34,85;%
+ 9,170,68,153;%
+ 0,221,221,221%
+ }
+ %
+ % Medium-contrast qualitative color scheme
+ \providecolorset{RGB}{T-Q-MC}{}{%
+ 1,255,255,255;%
+ 2,238,204,102;%
+ 3,238,153,170;%
+ 4,102,153,204;%
+ 5,153,119,0;%
+ 6,153,68,85;%
+ 7,0,68,136;%
+ 0,0,0,0%
+ }
+ %
+ % Pale qualitative color scheme, for highlighting
+ \providecolorset{RGB}{T-Q-PH}{}{%
+ 1,187,204,238;%
+ 2,204,238,255;%
+ 3,204,221,170;%
+ 4,238,238,187;%
+ 5,255,204,204;%
+ 0,221,221,221%
+ }
+ %
+ % Dark qualitative color scheme, for text colors
+ \providecolorset{RGB}{T-Q-DT}{}{%
+ 1,34,34,85;%
+ 2,34,85,85;%
+ 3,34,85,34;%
+ 4,102,102,51;%
+ 5,102,51,51;%
+ 0,85,85,85%
+ }
+ %
+ % Light qualitative color scheme
+ \providecolorset{RGB}{T-Q-L}{}{%
+ 1,119,170,221;%
+ 2,153,221,255;%
+ 3,68,187,153;%
+ 4,187,204,51;%
+ 5,170,170,0;%
+ 6,238,221,136;%
+ 7,238,136,102;%
+ 8,255,170,187;%
+ 0,221,221,221%
+ }
+ %
+ %<<< Qualitative color schemes
+ %
+ %>>> Diverging color schemes
+ %
+ % Sunset diverging color scheme
+ \providecolorset{RGB}{T-D-S}{}{%
+ 1,54,75,154;%
+ 2,74,123,183;%
+ 3,110,166,205;%
+ 4,152,202,225;%
+ 5,194,228,239;%
+ 6,234,236,204;%
+ 7,254,218,139;%
+ 8,253,179,102;%
+ 9,246,126,75;%
+ 10,221,61,45;%
+ 11,165,0,38;%
+ 0,255,255,255%
+ }
+ %
+ % Nightfall diverging color scheme
+ \providecolorset{RGB}{T-D-N}{}{%
+ 1,18,90,86;%
+ 2,0,118,123;%
+ 3,35,143,157;%
+ 4,66,167,198;%
+ 5,96,188,233;%
+ 6,157,204,239;%
+ 7,198,219,237;%
+ 8,222,230,231;%
+ 9,236,234,218;%
+ 10,240,230,178;%
+ 11,249,213,118;%
+ 12,255,185,84;%
+ 13,253,154,68;%
+ 14,245,118,52;%
+ 15,233,76,31;%
+ 16,209,24,7;%
+ 17,160,24,19;%
+ 0,255,255,255%
+ }
+ %
+ % BuRd diverging color scheme
+ \providecolorset{RGB}{T-D-BR}{}{%
+ 1,32,102,172;%
+ 2,67,147,195;%
+ 3,146,197,222;%
+ 4,209,229,240;%
+ 5,247,247,247;%
+ 6,253,219,199;%
+ 7,244,165,130;%
+ 8,214,96,77;%
+ 9,178,24,43;%
+ 0,255,238,153%
+ }
+ %
+ % PRGn diverging color scheme
+ \providecolorset{RGB}{T-D-PG}{}{%
+ 1,118,42,131;%
+ 2,153,112,171;%
+ 3,194,165,207;%
+ 4,231,212,232;%
+ 5,247,247,247;%
+ 6,217,240,211;%
+ 7,172,211,158;%
+ 8,90,174,97;%
+ 9,27,120,55;%
+ 0,255,238,153%
+ }
+ %
+ %<<< Diverging color schemes
+ %
+ %>>> Sequential color schemes
+ %
+ % YlOrBr sequential color scheme
+ \providecolorset{RGB}{T-S-YOB}{}{%
+ 1,255,255,229;%
+ 2,255,247,188;%
+ 3,254,227,145;%
+ 4,254,196,79;%
+ 5,251,154,41;%
+ 6,236,112,20;%
+ 7,204,76,2;%
+ 8,153,52,4;%
+ 9,102,37,6;%
+ 0,136,136,136%
+ }
+ %
+ % Iridescent sequential color scheme
+ \providecolorset{RGB}{T-S-IR}{}{%
+ 1,254,251,233;%
+ 2,252,247,213;%
+ 3,245,243,193;%
+ 4,234,240,181;%
+ 5,221,236,191;%
+ 6,208,231,202;%
+ 7,194,227,210;%
+ 8,181,221,216;%
+ 9,168,216,220;%
+ 10,155,210,225;%
+ 11,141,203,228;%
+ 12,129,196,231;%
+ 13,123,188,231;%
+ 14,126,178,228;%
+ 15,136,165,221;%
+ 16,147,152,210;%
+ 17,155,138,196;%
+ 18,157,125,178;%
+ 19,154,112,158;%
+ 20,144,99,136;%
+ 21,128,87,112;%
+ 22,104,73,87;%
+ 23,70,53,58;%
+ 0,153,153,153%
+ }
+ %
+ % Incandescent sequential color scheme
+ \providecolorset{RGB}{T-S-IN}{}{%
+ 1,206,255,255;%
+ 2,198,247,214;%
+ 3,162,244,155;%
+ 4,187,228,83;%
+ 5,213,206,4;%
+ 6,231,181,3;%
+ 7,241,153,3;%
+ 8,246,121,11;%
+ 9,249,73,2;%
+ 10,228,5,21;%
+ 11,168,0,3;%
+ 0,136,136,136%
+ }
+ %
+ % Discrete rainbow color scheme
+ \providecolorset{RGB}{T-S-DR}{}{%
+ 1,209,187,215;%
+ 2,174,118,163;%
+ 3,136,46,114;%
+ 4,25,101,176;%
+ 5,82,137,199;%
+ 6,123,175,222;%
+ 7,78,178,101;%
+ 8,144,201,135;%
+ 9,202,224,171;%
+ 10,247,240,86;%
+ 11,246,193,65;%
+ 12,241,147,45;%
+ 13,232,96,28;%
+ 14,220,5,12;%
+ 0,119,119,119%
+ }
+ %
+ % Smooth rainbow color scheme
+ \providecolorset{RGB}{T-S-SR}{}{%
+ 1,232,236,251;%
+ 2,221,216,239;%
+ 3,209,193,225;%
+ 4,195,168,209;%
+ 5,181,143,194;%
+ 6,167,120,180;%
+ 7,155,98,167;%
+ 8,140,78,153;%
+ 9,111,76,155;%
+ 10,96,89,169;%
+ 11,85,104,184;%
+ 12,78,121,197;%
+ 13,77,138,198;%
+ 14,78,150,188;%
+ 15,84,158,179;%
+ 16,89,165,169;%
+ 17,96,171,158;%
+ 18,105,177,144;%
+ 19,119,183,125;%
+ 20,140,188,104;%
+ 21,166,190,84;%
+ 22,190,188,72;%
+ 23,209,181,65;%
+ 24,221,170,60;%
+ 25,228,156,57;%
+ 26,231,140,53;%
+ 27,230,121,50;%
+ 28,228,99,45;%
+ 29,223,72,40;%
+ 30,218,34,34;%
+ 31,184,34,30;%
+ 32,149,33,27;%
+ 33,114,30,23;%
+ 34,82,26,19;%
+ 0,102,102,102%
+ }
+ %
+ %<<< Sequential color schemes
+ %
+ %<<< Color schemes by Paul Tol, source: https://personal.sron.nl/~pault
}
-%
-% Medium-contrast qualitative color scheme
-\providecolorset{RGB}{T-Q-MC}{}{%
- 1,255,255,255;%
- 2,238,204,102;%
- 3,238,153,170;%
- 4,102,153,204;%
- 5,153,119,0;%
- 6,153,68,85;%
- 7,0,68,136;%
- 0,0,0,0%
-}
-%
-% Pale qualitative color scheme, for highlighting
-\providecolorset{RGB}{T-Q-PH}{}{%
- 1,187,204,238;%
- 2,204,238,255;%
- 3,204,221,170;%
- 4,238,238,187;%
- 5,255,204,204;%
- 0,221,221,221%
-}
-%
-% Dark qualitative color scheme, for text colors
-\providecolorset{RGB}{T-Q-DT}{}{%
- 1,34,34,85;%
- 2,34,85,85;%
- 3,34,85,34;%
- 4,102,102,51;%
- 5,102,51,51;%
- 0,85,85,85%
-}
-%
-% Light qualitative color scheme
-\providecolorset{RGB}{T-Q-L}{}{%
- 1,119,170,221;%
- 2,153,221,255;%
- 3,68,187,153;%
- 4,187,204,51;%
- 5,170,170,0;%
- 6,238,221,136;%
- 7,238,136,102;%
- 8,255,170,187;%
- 0,221,221,221%
-}
-%
-%<<< Qualitative color schemes
-%
-%>>> Diverging color schemes
-%
-% Sunset diverging color scheme
-\providecolorset{RGB}{T-D-S}{}{%
- 1,54,75,154;%
- 2,74,123,183;%
- 3,110,166,205;%
- 4,152,202,225;%
- 5,194,228,239;%
- 6,234,236,204;%
- 7,254,218,139;%
- 8,253,179,102;%
- 9,246,126,75;%
- 10,221,61,45;%
- 11,165,0,38;%
- 0,255,255,255%
-}
-\pgfplotsset{
- colormap={T-D-S}{color(0)=(T-D-S1) color(1)=(T-D-S2) color(2)=(T-D-S3) color(3)=(T-D-S4) color(4)=(T-D-S5) color(5)=(T-D-S6) color(6)=(T-D-S7) color(7)=(T-D-S8) color(8)=(T-D-S9) color(9)=(T-D-S10) color(10)=(T-D-S11)}
-}
-%
-% Nightfall diverging color scheme
-\providecolorset{RGB}{T-D-N}{}{%
- 1,18,90,86;%
- 2,0,118,123;%
- 3,35,143,157;%
- 4,66,167,198;%
- 5,96,188,233;%
- 6,157,204,239;%
- 7,198,219,237;%
- 8,222,230,231;%
- 9,236,234,218;%
- 10,240,230,178;%
- 11,249,213,118;%
- 12,255,185,84;%
- 13,253,154,68;%
- 14,245,118,52;%
- 15,233,76,31;%
- 16,209,24,7;%
- 17,160,24,19;%
- 0,255,255,255%
-}
-\pgfplotsset{
- colormap={T-D-N}{color(0)=(T-D-N1) color(1)=(T-D-N2) color(2)=(T-D-N3) color(3)=(T-D-N4) color(4)=(T-D-N5) color(5)=(T-D-N6) color(6)=(T-D-N7) color(7)=(T-D-N8) color(8)=(T-D-N9) color(9)=(T-D-N10) color(10)=(T-D-N11) color(11)=(T-D-N12) color(12)=(T-D-N13) color(13)=(T-D-N14) color(14)=(T-D-N15) color(15)=(T-D-N16) color(16)=(T-D-N17)}
-}
-%
-% BuRd diverging color scheme
-\providecolorset{RGB}{T-D-BR}{}{%
- 1,32,102,172;%
- 2,67,147,195;%
- 3,146,197,222;%
- 4,209,229,240;%
- 5,247,247,247;%
- 6,253,219,199;%
- 7,244,165,130;%
- 8,214,96,77;%
- 9,178,24,43;%
- 0,255,238,153%
-}
-\pgfplotsset{
- colormap={T-D-BR}{color(0)=(T-D-BR1) color(1)=(T-D-BR2) color(2)=(T-D-BR3) color(3)=(T-D-BR4) color(4)=(T-D-BR5) color(5)=(T-D-BR6) color(6)=(T-D-BR7) color(7)=(T-D-BR8) color(8)=(T-D-BR9)}
-}
-%
-% PRGn diverging color scheme
-\providecolorset{RGB}{T-D-PG}{}{%
- 1,118,42,131;%
- 2,153,112,171;%
- 3,194,165,207;%
- 4,231,212,232;%
- 5,247,247,247;%
- 6,217,240,211;%
- 7,172,211,158;%
- 8,90,174,97;%
- 9,27,120,55;%
- 0,255,238,153%
-}
-\pgfplotsset{
- colormap={T-D-PG}{color(0)=(T-D-PG1) color(1)=(T-D-PG2) color(2)=(T-D-PG3) color(3)=(T-D-PG4) color(4)=(T-D-PG5) color(5)=(T-D-PG6) color(6)=(T-D-PG7) color(7)=(T-D-PG8) color(8)=(T-D-PG9)}
-}
-%
-%<<< Diverging color schemes
-%
-%>>> Sequential color schemes
-%
-% YlOrBr sequential color scheme
-\providecolorset{RGB}{T-S-YOB}{}{%
- 1,255,255,229;%
- 2,255,247,188;%
- 3,254,227,145;%
- 4,254,196,79;%
- 5,251,154,41;%
- 6,236,112,20;%
- 7,204,76,2;%
- 8,153,52,4;%
- 9,102,37,6;%
- 0,136,136,136%
-}
-\pgfplotsset{
- colormap={T-S-YOB}{color(0)=(T-S-YOB1) color(1)=(T-S-YOB2) color(2)=(T-S-YOB3) color(3)=(T-S-YOB4) color(4)=(T-S-YOB5) color(5)=(T-S-YOB6) color(6)=(T-S-YOB7) color(7)=(T-S-YOB8) color(8)=(T-S-YOB9)}
-}
-%
-% Iridescent sequential color scheme
-\providecolorset{RGB}{T-S-IR}{}{%
- 1,254,251,233;%
- 2,252,247,213;%
- 3,245,243,193;%
- 4,234,240,181;%
- 5,221,236,191;%
- 6,208,231,202;%
- 7,194,227,210;%
- 8,181,221,216;%
- 9,168,216,220;%
- 10,155,210,225;%
- 11,141,203,228;%
- 12,129,196,231;%
- 13,123,188,231;%
- 14,126,178,228;%
- 15,136,165,221;%
- 16,147,152,210;%
- 17,155,138,196;%
- 18,157,125,178;%
- 19,154,112,158;%
- 20,144,99,136;%
- 21,128,87,112;%
- 22,104,73,87;%
- 23,70,53,58;%
- 0,153,153,153%
-}
-\pgfplotsset{
- colormap={T-S-IR}{color(0)=(T-S-IR1) color(1)=(T-S-IR2) color(2)=(T-S-IR3) color(3)=(T-S-IR4) color(4)=(T-S-IR5) color(5)=(T-S-IR6) color(6)=(T-S-IR7) color(7)=(T-S-IR8) color(8)=(T-S-IR9) color(9)=(T-S-IR10) color(10)=(T-S-IR11) color(11)=(T-S-IR12) color(12)=(T-S-IR13) color(13)=(T-S-IR14) color(14)=(T-S-IR15) color(15)=(T-S-IR16) color(16)=(T-S-IR17) color(17)=(T-S-IR18) color(18)=(T-S-IR19) color(19)=(T-S-IR20) color(20)=(T-S-IR21) color(21)=(T-S-IR22) color(22)=(T-S-IR23)}
-}
-%
-% Incandescent sequential color scheme
-\providecolorset{RGB}{T-S-IN}{}{%
- 1,206,255,255;%
- 2,198,247,214;%
- 3,162,244,155;%
- 4,187,228,83;%
- 5,213,206,4;%
- 6,231,181,3;%
- 7,241,153,3;%
- 8,246,121,11;%
- 9,249,73,2;%
- 10,228,5,21;%
- 11,168,0,3;%
- 0,136,136,136%
-}
-\pgfplotsset{
- colormap={T-S-IN}{color(0)=(T-S-IN1) color(1)=(T-S-IN2) color(2)=(T-S-IN3) color(3)=(T-S-IN4) color(4)=(T-S-IN5) color(5)=(T-S-IN6) color(6)=(T-S-IN7) color(7)=(T-S-IN8) color(8)=(T-S-IN9) color(9)=(T-S-IN10) color(10)=(T-S-IN11)}
-}
-%
-% Discrete rainbow color scheme
-\providecolorset{RGB}{T-S-DR}{}{%
- 1,209,187,215;%
- 2,174,118,163;%
- 3,136,46,114;%
- 4,25,101,176;%
- 5,82,137,199;%
- 6,123,175,222;%
- 7,78,178,101;%
- 8,144,201,135;%
- 9,202,224,171;%
- 10,247,240,86;%
- 11,246,193,65;%
- 12,241,147,45;%
- 13,232,96,28;%
- 14,220,5,12;%
- 0,119,119,119%
-}
-%
-\providecolorset{RGB}{T-S-SR}{}{%
- 1,232,236,251;%
- 2,221,216,239;%
- 3,209,193,225;%
- 4,195,168,209;%
- 5,181,143,194;%
- 6,167,120,180;%
- 7,155,98,167;%
- 8,140,78,153;%
- 9,111,76,155;%
- 10,96,89,169;%
- 11,85,104,184;%
- 12,78,121,197;%
- 13,77,138,198;%
- 14,78,150,188;%
- 15,84,158,179;%
- 16,89,165,169;%
- 17,96,171,158;%
- 18,105,177,144;%
- 19,119,183,125;%
- 20,140,188,104;%
- 21,166,190,84;%
- 22,190,188,72;%
- 23,209,181,65;%
- 24,221,170,60;%
- 25,228,156,57;%
- 26,231,140,53;%
- 27,230,121,50;%
- 28,228,99,45;%
- 29,223,72,40;%
- 30,218,34,34;%
- 31,184,34,30;%
- 32,149,33,27;%
- 33,114,30,23;%
- 34,82,26,19;%
- 0,102,102,102%
-}
-\pgfplotsset{
- colormap={T-S-SR}{color(0)=(T-S-SR1) color(1)=(T-S-SR2) color(2)=(T-S-SR3) color(3)=(T-S-SR4) color(4)=(T-S-SR5) color(5)=(T-S-SR6) color(6)=(T-S-SR7) color(7)=(T-S-SR8) color(8)=(T-S-SR9) color(9)=(T-S-SR10) color(10)=(T-S-SR11) color(11)=(T-S-SR12) color(12)=(T-S-SR13) color(13)=(T-S-SR14) color(14)=(T-S-SR15) color(15)=(T-S-SR16) color(16)=(T-S-SR17) color(17)=(T-S-SR18) color(18)=(T-S-SR19) color(19)=(T-S-SR20) color(20)=(T-S-SR21) color(21)=(T-S-SR22) color(22)=(T-S-SR23) color(23)=(T-S-SR24) color(24)=(T-S-SR25) color(25)=(T-S-SR26) color(26)=(T-S-SR27) color(27)=(T-S-SR28) color(28)=(T-S-SR29) color(29)=(T-S-SR30) color(30)=(T-S-SR31) color(31)=(T-S-SR32) color(32)=(T-S-SR33) color(33)=(T-S-SR34)}
-}
-%
-%<<< Sequential color schemes
-%
-%<<< Color schemes by Paul Tol, source: https://personal.sron.nl/~pault
-}
\DeclareOption{OkabeIto}{
-%>>> Qualitative color scheme by Okabe and Ito
-\providecolorset{RGB}{OI}{}{%
- 1,230,159,0;%
- 2,86,180,233;%
- 3,0,158,115;%
- 4,240,228,66;%
- 5,0,114,178;%
- 6,213,94,0;%
- 7,204,121,167;%
- 0,0,0,0%
+ %>>> Qualitative color scheme by Okabe and Ito
+ \providecolorset{RGB}{OI}{}{%
+ 1,230,159,0;%
+ 2,86,180,233;%
+ 3,0,158,115;%
+ 4,240,228,66;%
+ 5,0,114,178;%
+ 6,213,94,0;%
+ 7,204,121,167;%
+ 0,0,0,0%
+ }
+ %<<< Qualitative color scheme by Okabe and Ito
}
-%<<< Qualitative color scheme by Okabe and Ito
-}
\DeclareOption*{\PackageWarning{colorblind}{Unknown '\CurrentOption'}}
\ProcessOptions\relax
-%>>> Function to print a discrete color scheme
-\newcommand\@drawSchemeRadius{0.7cm}
-\newcommand\@drawSchemeOffset{1cm}
-\newcounter{ColorNum}
-\newcommand\drawScheme[1]{%
- \tikz{%
- \node[inner sep=1, fill=red] at (-1.2*\@drawSchemeRadius,2.3*\@drawSchemeRadius) {R};
- \node[inner sep=1, fill=green] at (-1.2*\@drawSchemeRadius, 1.8*\@drawSchemeRadius) {G};
- \node[inner sep=1, fill=blue] at (-1.2*\@drawSchemeRadius,1.3*\@drawSchemeRadius) {B};
- \setcounter{ColorNum}{1}%
- \whiledo{%
- \@ifundefined{\string\color@#1\theColorNum}{\boolean{false}}{\boolean{true}}%
- }{%
- \extractcolorspecs{#1\the\value{ColorNum}}{\modelspec}{\colorspec}%
- \tikzmath{
- int \r, \g, \b;
- \r = round(255*array({\colorspec},0));
- \g = round(255*array({\colorspec},1));
- \b = round(255*array({\colorspec},2));
- }%
- \node at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,2.3*\@drawSchemeRadius) {\r};
- \node at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,1.8*\@drawSchemeRadius) {\g};
- \node at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,1.3*\@drawSchemeRadius) {\b};
- \draw[fill=#1\the\value{ColorNum}] (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,0) circle (\@drawSchemeRadius);%
- \node[rotate=25, anchor=north east] at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,-1*\@drawSchemeRadius) {#1\theColorNum};%
- \stepcounter{ColorNum}%
- }%
- \extractcolorspecs{#10}{\modelspec}{\colorspec}%
- \tikzmath{
- int \r, \g, \b;
- \r = round(255*array({\colorspec},0));
- \g = round(255*array({\colorspec},1));
- \b = round(255*array({\colorspec},2));
- }%
- \node at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,2.3*\@drawSchemeRadius) {\r};
- \node at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,1.8*\@drawSchemeRadius) {\g};
- \node at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,1.3*\@drawSchemeRadius) {\b};
- \draw[fill=#10] (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,0) circle(\@drawSchemeRadius);%
- \node[rotate=25, anchor=north east] at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset, -1*\@drawSchemeRadius) {#10};%
- }%
-}
-%<<< Function to print a discrete color scheme
+\ifredefinedefaults
+ % This redefines the default colors by removing most of them and setting
+ % the remaining to colors from the qualitative Vibrant color scheme by Tol.
+ \xdefinecolor{blue}{RGB}{68,119,170}
+ \xdefinecolor{cyan}{RGB}{102,204,238}
+ \xdefinecolor{green}{RGB}{34,136,51}
+ \xdefinecolor{yellow}{RGB}{204,187,68}
+ \xdefinecolor{red}{RGB}{238,102,119}
+ \xdefinecolor{violet}{RGB}{170,51,119}
+ \xdefinecolor{gray}{RGB}{187,187,187}
+ \xdefinecolor{orange}{RGB}{0,0,0}
+ \xdefinecolor{brown}{RGB}{0,0,0}
+ \xdefinecolor{darkgray}{RGB}{0,0,0}
+ \xdefinecolor{lightgray}{RGB}{0,0,0}
+ \xdefinecolor{lime}{RGB}{0,0,0}
+ \xdefinecolor{magenta}{RGB}{0,0,0}
+ \xdefinecolor{olive}{RGB}{0,0,0}
+ \xdefinecolor{pink}{RGB}{0,0,0}
+ \xdefinecolor{purple}{RGB}{0,0,0}
+ \xdefinecolor{teal}{RGB}{0,0,0}
+\fi
-%>>> Function to print a continuous color scheme
-\newcommand\drawSchemeC[2][0.5\textwidth]{%
- \tikz{%
- \pgfplotscolorbardrawstandalone[colormap name=#2, colorbar horizontal, colorbar style={width=#1, ticks=none}]%
- \draw[fill=#20] (#1+0.5*\@drawSchemeOffset,-0.55cm) circle(0.5*\@drawSchemeRadius);%
- }%
-}
-%<<< Function to print a continuous color scheme
+% define continuous colormaps and command to plot them if `pgf` option is given
+\ifpgf
+ % do nothing if option `Tol` was not provided, since then no applicable color schemes exist
+ \ifTolColors
+ \RequirePackage{pgfplots}
+ \pgfplotsset{compat=1.18}
+ % Sunset diverging colormap
+ \pgfplotsset{
+ colormap={T-D-S}{color(0)=(T-D-S1) color(1)=(T-D-S2) color(2)=(T-D-S3) color(3)=(T-D-S4) color(4)=(T-D-S5) color(5)=(T-D-S6) color(6)=(T-D-S7) color(7)=(T-D-S8) color(8)=(T-D-S9) color(9)=(T-D-S10) color(10)=(T-D-S11)}
+ }
+ % Nightfall diverging colormap
+ \pgfplotsset{
+ colormap={T-D-N}{color(0)=(T-D-N1) color(1)=(T-D-N2) color(2)=(T-D-N3) color(3)=(T-D-N4) color(4)=(T-D-N5) color(5)=(T-D-N6) color(6)=(T-D-N7) color(7)=(T-D-N8) color(8)=(T-D-N9) color(9)=(T-D-N10) color(10)=(T-D-N11) color(11)=(T-D-N12) color(12)=(T-D-N13) color(13)=(T-D-N14) color(14)=(T-D-N15) color(15)=(T-D-N16) color(16)=(T-D-N17)}
+ }
+ % BuRd diverging colormap
+ \pgfplotsset{
+ colormap={T-D-BR}{color(0)=(T-D-BR1) color(1)=(T-D-BR2) color(2)=(T-D-BR3) color(3)=(T-D-BR4) color(4)=(T-D-BR5) color(5)=(T-D-BR6) color(6)=(T-D-BR7) color(7)=(T-D-BR8) color(8)=(T-D-BR9)}
+ }
+ % PRGn diverging colormap
+ \pgfplotsset{
+ colormap={T-D-PG}{color(0)=(T-D-PG1) color(1)=(T-D-PG2) color(2)=(T-D-PG3) color(3)=(T-D-PG4) color(4)=(T-D-PG5) color(5)=(T-D-PG6) color(6)=(T-D-PG7) color(7)=(T-D-PG8) color(8)=(T-D-PG9)}
+ }
+ % YlOrBr sequential colormap
+ \pgfplotsset{
+ colormap={T-S-YOB}{color(0)=(T-S-YOB1) color(1)=(T-S-YOB2) color(2)=(T-S-YOB3) color(3)=(T-S-YOB4) color(4)=(T-S-YOB5) color(5)=(T-S-YOB6) color(6)=(T-S-YOB7) color(7)=(T-S-YOB8) color(8)=(T-S-YOB9)}
+ }
+ % Iridescent sequential colormap
+ \pgfplotsset{
+ colormap={T-S-IR}{color(0)=(T-S-IR1) color(1)=(T-S-IR2) color(2)=(T-S-IR3) color(3)=(T-S-IR4) color(4)=(T-S-IR5) color(5)=(T-S-IR6) color(6)=(T-S-IR7) color(7)=(T-S-IR8) color(8)=(T-S-IR9) color(9)=(T-S-IR10) color(10)=(T-S-IR11) color(11)=(T-S-IR12) color(12)=(T-S-IR13) color(13)=(T-S-IR14) color(14)=(T-S-IR15) color(15)=(T-S-IR16) color(16)=(T-S-IR17) color(17)=(T-S-IR18) color(18)=(T-S-IR19) color(19)=(T-S-IR20) color(20)=(T-S-IR21) color(21)=(T-S-IR22) color(22)=(T-S-IR23)}
+ }
+ % Incandescent sequential colormap
+ \pgfplotsset{
+ colormap={T-S-IN}{color(0)=(T-S-IN1) color(1)=(T-S-IN2) color(2)=(T-S-IN3) color(3)=(T-S-IN4) color(4)=(T-S-IN5) color(5)=(T-S-IN6) color(6)=(T-S-IN7) color(7)=(T-S-IN8) color(8)=(T-S-IN9) color(9)=(T-S-IN10) color(10)=(T-S-IN11)}
+ }
+ % Smooth Rainbow sequential colormap
+ \pgfplotsset{
+ colormap={T-S-SR}{color(0)=(T-S-SR1) color(1)=(T-S-SR2) color(2)=(T-S-SR3) color(3)=(T-S-SR4) color(4)=(T-S-SR5) color(5)=(T-S-SR6) color(6)=(T-S-SR7) color(7)=(T-S-SR8) color(8)=(T-S-SR9) color(9)=(T-S-SR10) color(10)=(T-S-SR11) color(11)=(T-S-SR12) color(12)=(T-S-SR13) color(13)=(T-S-SR14) color(14)=(T-S-SR15) color(15)=(T-S-SR16) color(16)=(T-S-SR17) color(17)=(T-S-SR18) color(18)=(T-S-SR19) color(19)=(T-S-SR20) color(20)=(T-S-SR21) color(21)=(T-S-SR22) color(22)=(T-S-SR23) color(23)=(T-S-SR24) color(24)=(T-S-SR25) color(25)=(T-S-SR26) color(26)=(T-S-SR27) color(27)=(T-S-SR28) color(28)=(T-S-SR29) color(29)=(T-S-SR30) color(30)=(T-S-SR31) color(31)=(T-S-SR32) color(32)=(T-S-SR33) color(33)=(T-S-SR34)}
+ }
+ %
+ %>>> Function to print a continuous color scheme
+ \newcommand\drawSchemeC[2][0.5\textwidth]{%
+ \tikz{%
+ \pgfplotscolorbardrawstandalone[colormap name=#2, colorbar horizontal, colorbar style={width=#1, ticks=none}]%
+ \draw[fill=#20] (#1+0.5*\@drawSchemeOffset,-0.55cm) circle(0.5*\@drawSchemeRadius);%
+ }%
+ }
+ %<<< Function to print a continuous color scheme
+ \fi
+\fi
+% define command to draw discrete color schemes when tikz is enabled
+\iftikz
+ \RequirePackage{tikz}
+ \usetikzlibrary{math}
+ %>>> Function to print a discrete color scheme
+ \newcommand\@drawSchemeRadius{0.7cm}
+ \newcommand\@drawSchemeOffset{1cm}
+ \newcounter{ColorNum}
+ \newcommand\drawScheme[1]{%
+ \tikz{%
+ \node[inner sep=1, fill=red] at (-1.2*\@drawSchemeRadius,2.3*\@drawSchemeRadius) {R};
+ \node[inner sep=1, fill=green] at (-1.2*\@drawSchemeRadius, 1.8*\@drawSchemeRadius) {G};
+ \node[inner sep=1, fill=blue] at (-1.2*\@drawSchemeRadius,1.3*\@drawSchemeRadius) {B};
+ \setcounter{ColorNum}{1}%
+ \whiledo{%
+ \@ifundefined{\string\color@#1\theColorNum}{\boolean{false}}{\boolean{true}}%
+ }{%
+ \extractcolorspecs{#1\the\value{ColorNum}}{\modelspec}{\colorspec}%
+ \tikzmath{
+ int \r, \g, \b;
+ \r = round(255*array({\colorspec},0));
+ \g = round(255*array({\colorspec},1));
+ \b = round(255*array({\colorspec},2));
+ }%
+ \node at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,2.3*\@drawSchemeRadius) {\r};
+ \node at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,1.8*\@drawSchemeRadius) {\g};
+ \node at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,1.3*\@drawSchemeRadius) {\b};
+ \draw[fill=#1\the\value{ColorNum}] (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,0) circle (\@drawSchemeRadius);%
+ \node[rotate=25, anchor=north east] at (\value{ColorNum}*\@drawSchemeOffset-\@drawSchemeOffset,-1*\@drawSchemeRadius) {#1\theColorNum};%
+ \stepcounter{ColorNum}%
+ }%
+ \extractcolorspecs{#10}{\modelspec}{\colorspec}%
+ \tikzmath{
+ int \r, \g, \b;
+ \r = round(255*array({\colorspec},0));
+ \g = round(255*array({\colorspec},1));
+ \b = round(255*array({\colorspec},2));
+ }%
+ \node at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,2.3*\@drawSchemeRadius) {\r};
+ \node at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,1.8*\@drawSchemeRadius) {\g};
+ \node at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,1.3*\@drawSchemeRadius) {\b};
+ \draw[fill=#10] (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset,0) circle(\@drawSchemeRadius);%
+ \node[rotate=25, anchor=north east] at (\value{ColorNum}*\@drawSchemeOffset-0.5*\@drawSchemeOffset, -1*\@drawSchemeRadius) {#10};%
+ }%
+ }
+ %<<< Function to print a discrete color scheme
+\fi
+
\endinput
More information about the tex-live-commits
mailing list.