# ColorADD symbols/code or other solutions for colorblind in LaTeX/TikZ

Since I got a student this year, that is unable to see colors I thought this might be a problem others ran into as well. The most obvious thing that I could think of was "How is he able to play UNO?" ... and there is a version of UNO using the color alphabet provided by ColorADD to help in that case.

I couldn't find any equivalent for LaTeX/TikZ that I could use in graphics (e.g. if I plot some graphs and want the students to tell me the function I usually use different colors and/or different letters. In my biology figures they are usually colored but since that doesn't work any longer I used patterns).

But these are my solutions and the system provided by ColorADD seems to be something bigger.

My question: Does anybody know an equal approach to identify/translate colors via symbols that is used commonly? Is there any other method that I could use to help a student who isn't able to see any colors at all?

PS: I ran into the work of Paul Tol but this only seems to help if there is a red- or green-blind-vision. For my student those are all different types of gray so he prefers high contrast solutions in black and white.

Welcome! One can define pics for these symbols. What makes this delicate/interesting is that the color and placement of the components depend on whether or not other components are present. This proposal takes care of this by first starting a survey and then draw the components. That way if you say

\pic{ADD={red,white,blue}};


you will get

whereas if you add yellow,

\pic{ADD={red,white,blue,yellow}};


you get

and if you replace white by black

This is the full code with these and more examples:

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{backgrounds}
\makeatletter% https://tex.stackexchange.com/a/515305/194703
\tikzset{scale line widths/.style={%
/utils/exec=\pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
\pgfmathsetmacro{\myJacobian}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}%
\pgfmathsetlength\pgflinewidth{\myJacobian*0.4pt}%
thin}}
\makeatother
}},
white/.code={},blue/.code={},red/.code={},
white/.code={\draw[rounded corners=3pt,scale line widths,line width=0.6mm]
(-0.47,-0.47) rectangle (0.47,0.47);},
black/.code={\begin{scope}[on background layer]
\fill[black] [rounded corners=3pt] (-0.5,-0.5) rectangle (0.5,0.5);
\end{scope}},
|- ++ (0.5,0.5) --
cycle;},
(-0.2,-0.25) \ifADDcontainsyellow ++(-60:0.1) \fi -| ++ (0.5,0.5) --
cycle;},
yellow/.code={\draw[line cap=round,scale line widths,line width=0.7mm]
\begin{document}
\begin{tikzpicture}
\end{tikzpicture}
\end{document}


As you can see, by saying

\path (<x>,<y>) pic{ADD=...};


you move the symbol to the coordinates. Some part of the preamble is only to ensure scalability.

The Venn diagram from your link can be obtained e.g. using this unofficial library.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{backgrounds,venn}
\makeatletter% https://tex.stackexchange.com/a/515305/194703
\tikzset{scale line widths/.style={%
/utils/exec=\pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
\pgfmathsetmacro{\myJacobian}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}%
\pgfmathsetlength\pgflinewidth{\myJacobian*0.4pt}%
thin}}
\makeatother
}},
white/.code={},blue/.code={},red/.code={},
white/.code={\draw[rounded corners=3pt,scale line widths,line width=0.6mm]
(-0.47,-0.47) rectangle (0.47,0.47);},
black/.code={\begin{scope}[on background layer]
\fill[black] [rounded corners=3pt] (-0.5,-0.5) rectangle (0.5,0.5);
\end{scope}},
|- ++ (0.5,0.5) --
cycle;},
(-0.2,-0.25) \ifADDcontainsyellow ++(-60:0.1) \fi -| ++ (0.5,0.5) --
cycle;},
yellow/.code={\draw[line cap=round,scale line widths,line width=0.7mm]
\begin{document}
\begin{tikzpicture}[Venn diagram={offset angle=60,
all labels/.style={opacity=0},
\begin{scope}
\clip[current reverse clip,venn/set=A];
\clip[current reverse clip,venn/set=B];
\fill[red,venn/set=C];
\end{scope}
\begin{scope}
\clip[current reverse clip,venn/set=C];
\clip[current reverse clip,venn/set=A];
\fill[blue,venn/set=B];
\end{scope}
\begin{scope}
\clip[current reverse clip,venn/set=B];
\clip[current reverse clip,venn/set=C];
\fill[yellow,venn/set=A];
\end{scope}
\path[fill=green,venn/and={A and B}];
\path[fill=orange,venn/and={A and C}];
\path[fill=purple,venn/and={B and C}];
\begin{scope}
\clip[venn/set=A];
\clip[venn/set=B];
\fill[venn/set=C];
\end{scope}

• As always, great work! Can I suggest you to replace the value 2.7pt for the rounded corner of the rectangle (-0.45,-0.45) rectangle (0.45,0.45) in white/.code (in the first code) by a smaller value? I find that a value of 1.58pt gives a better look for the inner rounded corner of the border (so the border is not inflated in corners). The value 1.58pt comes from 3 pt minus 1.42 pt (the width of the border is 0.5 cm - 0.45 cm = 0.05 cm = 1.42 pt) – quark67 Jan 3 '20 at 4:00