2

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.

3

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

enter image description here

whereas if you add yellow,

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

you get

enter image description here

and if you replace white by black

enter image description here

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}%
\def\tikz@semiaddlinewidth##1{\pgfmathsetmacro{\my@lw}{\myJacobian*##1}%
\tikz@addoption{\pgfsetlinewidth{\my@lw pt}}\pgfmathsetlength\pgflinewidth{\my@lw pt}},%
thin}}
\makeatother
\newif\ifADDcontainsyellow
\newif\ifADDcontainsblack
\tikzset{pics/ADD/.style={code={
\tikzset{ADD survey/.cd,#1}
\tikzset{ADD/.cd,#1}
}},
/tikz/ADD survey/.cd,
white/.code={},blue/.code={},red/.code={},
yellow/.code={\ADDcontainsyellowtrue},black/.code={\ADDcontainsblacktrue},
/tikz/ADD/.cd,
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}},
red/.code={\fill[rounded corners=1.8pt] \ifADDcontainsblack [white]\fi
(-0.3,-0.25) \ifADDcontainsyellow ++(120:0.1) \fi
 |- ++ (0.5,0.5) --
cycle;},
blue/.code={\fill[rounded corners=1.8pt]  \ifADDcontainsblack [white]\fi
(-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]
 \ifADDcontainsblack [white]\fi (-0.35,-0.35) -- (0.35,0.35);}}
\begin{document}
\begin{tikzpicture}
 \path pic{ADD={red,white,blue}}
 (1.5,0) pic{ADD={red,white,blue,yellow}}
 (3,0) pic{ADD={red,black,blue}}
 (4.5,0) pic{ADD={blue,yellow,red,black}}
 (6,0) pic{ADD={red,blue}};
\end{tikzpicture}
\end{document}

enter image description here

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}%
\def\tikz@semiaddlinewidth##1{\pgfmathsetmacro{\my@lw}{\myJacobian*##1}%
\tikz@addoption{\pgfsetlinewidth{\my@lw pt}}\pgfmathsetlength\pgflinewidth{\my@lw pt}},%
thin}}
\makeatother
\newif\ifADDcontainsyellow
\newif\ifADDcontainsblack
\tikzset{pics/ADD/.style={code={
\tikzset{ADD survey/.cd,#1}
\tikzset{ADD/.cd,#1}
}},
/tikz/ADD survey/.cd,
white/.code={},blue/.code={},red/.code={},
yellow/.code={\ADDcontainsyellowtrue},black/.code={\ADDcontainsblacktrue},
/tikz/ADD/.cd,
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}},
red/.code={\fill[rounded corners=1.8pt] \ifADDcontainsblack [white]\fi
(-0.3,-0.25) \ifADDcontainsyellow ++(120:0.1) \fi
 |- ++ (0.5,0.5) --
cycle;},
blue/.code={\fill[rounded corners=1.8pt]  \ifADDcontainsblack [white]\fi
(-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]
 \ifADDcontainsblack [white]\fi (-0.35,-0.35) -- (0.35,0.35);}}
\begin{document}
\begin{tikzpicture}[Venn diagram={offset angle=60,
 all labels/.style={opacity=0},
 radius=1.4cm,distance=1cm}]
 \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}
 \path[scale=0.7,transform shape] (-150:2) pic{ADD={yellow}}
  (-30:2) pic{ADD={blue}} (90:2) pic{ADD={red}}
  (-90:1.3) pic{ADD={yellow,blue}}
  (150:1.3) pic{ADD={yellow,red}}
  (30:1.3) pic{ADD={blue,red}} ;
\end{tikzpicture}
\end{document}

enter image description here

3
  • 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
  • @quark67 Thanks! I agree with your point, but solved it slightly differently by just drawing line with some rounded corners and scaling line widths. – user194703 Jan 3 '20 at 4:12
  • Wow this sure helps a lot! Thanks for all the work you put in there. I thought there might be some symbol package out there that I didn't know or something similar to patterns. I didn't expect someone to actually build the whole thing complete with a shortcut! You are awesome! – Sk1nk Jan 4 '20 at 12:21

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.