%%
%% ----------------------------------------------------------------
%% Copyright (C) 2023-2026 by Simon Pfahler <simon.pfahler at ur dot de>
%% ----------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{colorblind}[2026/01/19 Easy colorblind-safe typesetting]

\RequirePackage{xcolor}
\RequirePackage{ifthen}

\newif\iftikz
\tikztrue
\DeclareOption{no-tikz}{
	\tikzfalse
}

\newif\ifpgf
\pgffalse
\DeclareOption{pgf}{
	\pgftrue
}

\newif\ifredefinedefaults
\redefinedefaultstrue
\DeclareOption{keep-defaults}{
	\redefinedefaultsfalse
}

\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/cmyk}{T-Q-B}{}{%
		1,68,119,170/0.60000,0.30000,0.00000,0.33333;%
		2,102,204,238/0.57143,0.14286,0.00000,0.06667;%
		3,34,136,51/0.75000,0.00000,0.62500,0.46667;%
		4,204,187,68/0.00000,0.08333,0.66667,0.20000;%
		5,238,102,119/0.00000,0.57143,0.50000,0.06667;%
		6,170,51,119/0.00000,0.70000,0.30000,0.33333;%
		0,187,187,187/0.00000,0.00000,0.00000,0.26667%
	}
	%
	% High-contrast qualitative color scheme
	\providecolorset{RGB/cmyk}{T-Q-HC}{}{%
		1,255,255,255/0.00000,0.00000,0.00000,0.00000;%
		2,221,170,51/0.00000,0.23077,0.76923,0.13333;%
		3,187,85,102/0.00000,0.54545,0.45455,0.26667;%
		4,0,68,136/1.00000,0.50000,0.00000,0.46667;%
		0,0,0,0/0.00000,0.00000,0.00000,1.00000%
	}
	%
	% Vibrant qualitative color scheme
	\providecolorset{RGB/cmyk}{T-Q-V}{}{%
		1,0,119,187/1.00000,0.36364,0.00000,0.26667;%
		2,51,187,238/0.78571,0.21429,0.00000,0.06667;%
		3,0,153,136/1.00000,0.00000,0.11111,0.40000;%
		4,238,119,51/0.00000,0.50000,0.78571,0.06667;%
		5,204,51,17/0.00000,0.75000,0.91667,0.20000;%
		6,238,51,119/0.00000,0.78571,0.50000,0.06667;%
		0,187,187,187/0.00000,0.00000,0.00000,0.26667%
	}
	%
	% Muted qualitative color scheme
	\providecolorset{RGB/cmyk}{T-Q-M}{}{%
		1,51,34,136/0.62500,0.75000,0.00000,0.46667;%
		2,136,204,238/0.42857,0.14286,0.00000,0.06667;%
		3,68,170,153/0.60000,0.00000,0.10000,0.33333;%
		4,17,119,51/0.85714,0.00000,0.57143,0.53333;%
		5,153,153,51/0.00000,0.00000,0.66667,0.40000;%
		6,221,204,119/0.00000,0.07692,0.46154,0.13333;%
		7,204,102,119/0.00000,0.50000,0.41667,0.20000;%
		8,136,34,85/0.00000,0.75000,0.37500,0.46667;%
		9,170,68,153/0.00000,0.60000,0.10000,0.33333;%
		0,221,221,221/0.00000,0.00000,0.00000,0.13333%
	}
	%
	% Medium-contrast qualitative color scheme
	\providecolorset{RGB/cmyk}{T-Q-MC}{}{%
		1,255,255,255/0.00000,0.00000,0.00000,0.00000;%
		2,238,204,102/0.00000,0.14286,0.57143,0.06667;%
		3,238,153,170/0.00000,0.35714,0.28571,0.06667;%
		4,102,153,204/0.50000,0.25000,0.00000,0.20000;%
		5,153,119,0/0.00000,0.22222,1.00000,0.40000;%
		6,153,68,85/0.00000,0.55556,0.44444,0.40000;%
		7,0,68,136/1.00000,0.50000,0.00000,0.46667;%
		0,0,0,0/0.00000,0.00000,0.00000,1.00000%
	}
	%
	% Pale qualitative color scheme, for highlighting
	\providecolorset{RGB/cmyk}{T-Q-PH}{}{%
		1,187,204,238/0.21429,0.14286,0.00000,0.06667;%
		2,204,238,255/0.20000,0.06667,0.00000,0.00000;%
		3,204,221,170/0.07692,0.00000,0.23077,0.13333;%
		4,238,238,187/0.00000,0.00000,0.21429,0.06667;%
		5,255,204,204/0.00000,0.20000,0.20000,0.00000;%
		0,221,221,221/0.00000,0.00000,0.00000,0.13333%
	}
	%
	% Dark qualitative color scheme, for text colors
	\providecolorset{RGB/cmyk}{T-Q-DT}{}{%
		1,34,34,85/0.60000,0.60000,0.00000,0.66667;%
		2,34,85,85/0.60000,0.00000,0.00000,0.66667;%
		3,34,85,34/0.60000,0.00000,0.60000,0.66667;%
		4,102,102,51/0.00000,0.00000,0.50000,0.60000;%
		5,102,51,51/0.00000,0.50000,0.50000,0.60000;%
		0,85,85,85/0.00000,0.00000,0.00000,0.66667%
	}
	%
	% Light qualitative color scheme
	\providecolorset{RGB/cmyk}{T-Q-L}{}{%
		1,119,170,221/0.46154,0.23077,0.00000,0.13333;%
		2,153,221,255/0.40000,0.13333,0.00000,0.00000;%
		3,68,187,153/0.63636,0.00000,0.18182,0.26667;%
		4,187,204,51/0.08333,0.00000,0.75000,0.20000;%
		5,170,170,0/0.00000,0.00000,1.00000,0.33333;%
		6,238,221,136/0.00000,0.07143,0.42857,0.06667;%
		7,238,136,102/0.00000,0.42857,0.57143,0.06667;%
		8,255,170,187/0.00000,0.33333,0.26667,0.00000;%
		0,221,221,221/0.00000,0.00000,0.00000,0.13333%
	}
	%
	%<<< Qualitative color schemes
	%
	%>>> Diverging color schemes
	%
	% Sunset diverging color scheme
	\providecolorset{RGB/cmyk}{T-D-S}{}{%
		1,54,75,154/0.64935,0.51299,0.00000,0.39608;%
		2,74,123,183/0.59563,0.32787,0.00000,0.28235;%
		3,110,166,205/0.46341,0.19024,0.00000,0.19608;%
		4,152,202,225/0.32444,0.10222,0.00000,0.11765;%
		5,194,228,239/0.18828,0.04603,0.00000,0.06275;%
		6,234,236,204/0.00847,0.00000,0.13559,0.07451;%
		7,254,218,139/0.00000,0.14173,0.45276,0.00392;%
		8,253,179,102/0.00000,0.29249,0.59684,0.00784;%
		9,246,126,75/0.00000,0.48780,0.69512,0.03529;%
		10,221,61,45/0.00000,0.72398,0.79638,0.13333;%
		11,165,0,38/0.00000,1.00000,0.76970,0.35294;%
		0,255,255,255/0.00000,0.00000,0.00000,0.00000%
	}
	%
	% Nightfall diverging color scheme
	\providecolorset{RGB/cmyk}{T-D-N}{}{%
		1,18,90,86/0.80000,0.00000,0.04444,0.64706;%
		2,0,118,123/1.00000,0.04065,0.00000,0.51765;%
		3,35,143,157/0.77707,0.08917,0.00000,0.38431;%
		4,66,167,198/0.66667,0.15657,0.00000,0.22353;%
		5,96,188,233/0.58798,0.19313,0.00000,0.08627;%
		6,157,204,239/0.34310,0.14644,0.00000,0.06275;%
		7,198,219,237/0.16456,0.07595,0.00000,0.07059;%
		8,222,230,231/0.03896,0.00433,0.00000,0.09412;%
		9,236,234,218/0.00000,0.00847,0.07627,0.07451;%
		10,240,230,178/0.00000,0.04167,0.25833,0.05882;%
		11,249,213,118/0.00000,0.14458,0.52610,0.02353;%
		12,255,185,84/0.00000,0.27451,0.67059,0.00000;%
		13,253,154,68/0.00000,0.39130,0.73123,0.00784;%
		14,245,118,52/0.00000,0.51837,0.78776,0.03922;%
		15,233,76,31/0.00000,0.67382,0.86695,0.08627;%
		16,209,24,7/0.00000,0.88517,0.96651,0.18039;%
		17,160,24,19/0.00000,0.85000,0.88125,0.37255;%
		0,255,255,255/0.00000,0.00000,0.00000,0.00000%
	}
	%
	% BuRd diverging color scheme
	\providecolorset{RGB/cmyk}{T-D-BR}{}{%
		1,32,102,172/0.81395,0.40698,0.00000,0.32549;%
		2,67,147,195/0.65641,0.24615,0.00000,0.23529;%
		3,146,197,222/0.34234,0.11261,0.00000,0.12941;%
		4,209,229,240/0.12917,0.04583,0.00000,0.05882;%
		5,247,247,247/0.00000,0.00000,0.00000,0.03137;%
		6,253,219,199/0.00000,0.13439,0.21344,0.00784;%
		7,244,165,130/0.00000,0.32377,0.46721,0.04314;%
		8,214,96,77/0.00000,0.55140,0.64019,0.16078;%
		9,178,24,43/0.00000,0.86517,0.75843,0.30196;%
		0,255,238,153/0.00000,0.06667,0.40000,0.00000%
	}
	%
	% PRGn diverging color scheme
	\providecolorset{RGB/cmyk}{T-D-PG}{}{%
		1,118,42,131/0.09924,0.67939,0.00000,0.48627;%
		2,153,112,171/0.10526,0.34503,0.00000,0.32941;%
		3,194,165,207/0.06280,0.20290,0.00000,0.18824;%
		4,231,212,232/0.00431,0.08621,0.00000,0.09020;%
		5,247,247,247/0.00000,0.00000,0.00000,0.03137;%
		6,217,240,211/0.09583,0.00000,0.12083,0.05882;%
		7,172,211,158/0.18483,0.00000,0.25118,0.17255;%
		8,90,174,97/0.48276,0.00000,0.44253,0.31765;%
		9,27,120,55/0.77500,0.00000,0.54167,0.52941;%
		0,255,238,153/0.00000,0.06667,0.40000,0.00000%
	}
	%
	%<<< Diverging color schemes
	%
	%>>> Sequential color schemes
	%
	% YlOrBr sequential color scheme
	\providecolorset{RGB/cmyk}{T-S-YOB}{}{%
		1,255,255,229/0.00000,0.00000,0.10196,0.00000;%
		2,255,247,188/0.00000,0.03137,0.26275,0.00000;%
		3,254,227,145/0.00000,0.10630,0.42913,0.00392;%
		4,254,196,79/0.00000,0.22835,0.68898,0.00392;%
		5,251,154,41/0.00000,0.38645,0.83665,0.01569;%
		6,236,112,20/0.00000,0.52542,0.91525,0.07451;%
		7,204,76,2/0.00000,0.62745,0.99020,0.20000;%
		8,153,52,4/0.00000,0.66013,0.97386,0.40000;%
		9,102,37,6/0.00000,0.63725,0.94118,0.60000;%
		0,136,136,136/0.00000,0.00000,0.00000,0.46667%
	}
	%
	% Iridescent sequential color scheme
	\providecolorset{RGB/cmyk}{T-S-IR}{}{%
		1,254,251,233/0.00000,0.01181,0.08268,0.00392;%
		2,252,247,213/0.00000,0.01984,0.15476,0.01176;%
		3,245,243,193/0.00000,0.00816,0.21224,0.03922;%
		4,234,240,181/0.02500,0.00000,0.24583,0.05882;%
		5,221,236,191/0.06356,0.00000,0.19068,0.07451;%
		6,208,231,202/0.09957,0.00000,0.12554,0.09412;%
		7,194,227,210/0.14537,0.00000,0.07489,0.10980;%
		8,181,221,216/0.18100,0.00000,0.02262,0.13333;%
		9,168,216,220/0.23636,0.01818,0.00000,0.13725;%
		10,155,210,225/0.31111,0.06667,0.00000,0.11765;%
		11,141,203,228/0.38158,0.10965,0.00000,0.10588;%
		12,129,196,231/0.44156,0.15152,0.00000,0.09412;%
		13,123,188,231/0.46753,0.18615,0.00000,0.09412;%
		14,126,178,228/0.44737,0.21930,0.00000,0.10588;%
		15,136,165,221/0.38462,0.25339,0.00000,0.13333;%
		16,147,152,210/0.30000,0.27619,0.00000,0.17647;%
		17,155,138,196/0.20918,0.29592,0.00000,0.23137;%
		18,157,125,178/0.11798,0.29775,0.00000,0.30196;%
		19,154,112,158/0.02532,0.29114,0.00000,0.38039;%
		20,144,99,136/0.00000,0.31250,0.05556,0.43529;%
		21,128,87,112/0.00000,0.32031,0.12500,0.49804;%
		22,104,73,87/0.00000,0.29808,0.16346,0.59216;%
		23,70,53,58/0.00000,0.24286,0.17143,0.72549;%
		0,153,153,153/0.00000,0.00000,0.00000,0.40000%
	}
	%
	% Incandescent sequential color scheme
	\providecolorset{RGB/cmyk}{T-S-IN}{}{%
		1,206,255,255/0.19216,0.00000,0.00000,0.00000;%
		2,198,247,214/0.19838,0.00000,0.13360,0.03137;%
		3,162,244,155/0.33607,0.00000,0.36475,0.04314;%
		4,187,228,83/0.17982,0.00000,0.63596,0.10588;%
		5,213,206,4/0.00000,0.03286,0.98122,0.16471;%
		6,231,181,3/0.00000,0.21645,0.98701,0.09412;%
		7,241,153,3/0.00000,0.36515,0.98755,0.05490;%
		8,246,121,11/0.00000,0.50813,0.95528,0.03529;%
		9,249,73,2/0.00000,0.70683,0.99197,0.02353;%
		10,228,5,21/0.00000,0.97807,0.90789,0.10588;%
		11,168,0,3/0.00000,1.00000,0.98214,0.34118;%
		0,136,136,136/0.00000,0.00000,0.00000,0.46667%
	}
	%
	% Discrete rainbow color scheme
	\providecolorset{RGB/cmyk}{T-S-DR}{}{%
		1,209,187,215/0.02791,0.13023,0.00000,0.15686;%
		2,174,118,163/0.00000,0.32184,0.06322,0.31765;%
		3,136,46,114/0.00000,0.66176,0.16176,0.46667;%
		4,25,101,176/0.85795,0.42614,0.00000,0.30980;%
		5,82,137,199/0.58794,0.31156,0.00000,0.21961;%
		6,123,175,222/0.44595,0.21171,0.00000,0.12941;%
		7,78,178,101/0.56180,0.00000,0.43258,0.30196;%
		8,144,201,135/0.28358,0.00000,0.32836,0.21176;%
		9,202,224,171/0.09821,0.00000,0.23661,0.12157;%
		10,247,240,86/0.00000,0.02834,0.65182,0.03137;%
		11,246,193,65/0.00000,0.21545,0.73577,0.03529;%
		12,241,147,45/0.00000,0.39004,0.81328,0.05490;%
		13,232,96,28/0.00000,0.58621,0.87931,0.09020;%
		14,220,5,12/0.00000,0.97727,0.94545,0.13725;%
		0,119,119,119/0.00000,0.00000,0.00000,0.53333%
	}
	%
	% Smooth rainbow color scheme
	\providecolorset{RGB/cmyk}{T-S-SR}{}{%
		1,232,236,251/0.07570,0.05976,0.00000,0.01569;%
		2,221,216,239/0.07531,0.09623,0.00000,0.06275;%
		3,209,193,225/0.07111,0.14222,0.00000,0.11765;%
		4,195,168,209/0.06699,0.19617,0.00000,0.18039;%
		5,181,143,194/0.06701,0.26289,0.00000,0.23922;%
		6,167,120,180/0.07222,0.33333,0.00000,0.29412;%
		7,155,98,167/0.07186,0.41317,0.00000,0.34510;%
		8,140,78,153/0.08497,0.49020,0.00000,0.40000;%
		9,111,76,155/0.28387,0.50968,0.00000,0.39216;%
		10,96,89,169/0.43195,0.47337,0.00000,0.33725;%
		11,85,104,184/0.53804,0.43478,0.00000,0.27843;%
		12,78,121,197/0.60406,0.38579,0.00000,0.22745;%
		13,77,138,198/0.61111,0.30303,0.00000,0.22353;%
		14,78,150,188/0.58511,0.20213,0.00000,0.26275;%
		15,84,158,179/0.53073,0.11732,0.00000,0.29804;%
		16,89,165,169/0.47337,0.02367,0.00000,0.33725;%
		17,96,171,158/0.43860,0.00000,0.07602,0.32941;%
		18,105,177,144/0.40678,0.00000,0.18644,0.30588;%
		19,119,183,125/0.34973,0.00000,0.31694,0.28235;%
		20,140,188,104/0.25532,0.00000,0.44681,0.26275;%
		21,166,190,84/0.12632,0.00000,0.55789,0.25490;%
		22,190,188,72/0.00000,0.01053,0.62105,0.25490;%
		23,209,181,65/0.00000,0.13397,0.68900,0.18039;%
		24,221,170,60/0.00000,0.23077,0.72851,0.13333;%
		25,228,156,57/0.00000,0.31579,0.75000,0.10588;%
		26,231,140,53/0.00000,0.39394,0.77056,0.09412;%
		27,230,121,50/0.00000,0.47391,0.78261,0.09804;%
		28,228,99,45/0.00000,0.56579,0.80263,0.10588;%
		29,223,72,40/0.00000,0.67713,0.82063,0.12549;%
		30,218,34,34/0.00000,0.84404,0.84404,0.14510;%
		31,184,34,30/0.00000,0.81522,0.83696,0.27843;%
		32,149,33,27/0.00000,0.77852,0.81879,0.41569;%
		33,114,30,23/0.00000,0.73684,0.79825,0.55294;%
		34,82,26,19/0.00000,0.68293,0.76829,0.67843;%
		0,102,102,102/0.00000,0.00000,0.00000,0.60000%
	}
	%
	%<<< 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/cmyk}{OI}{}{%
		1,230,159,0/0.00000,0.30870,1.00000,0.09804;%
		2,86,180,233/0.63090,0.22747,0.00000,0.08627;%
		3,0,158,115/1.00000,0.00000,0.27215,0.38039;%
		4,240,228,66/0.00000,0.05000,0.72500,0.05882;%
		5,0,114,178/1.00000,0.35955,0.00000,0.30196;%
		6,213,94,0/0.00000,0.55869,1.00000,0.16471;%
		7,204,121,167/0.00000,0.40686,0.18137,0.20000;%
		0,0,0,0/0.00000,0.00000,0.00000,1.00000%
	}
	%<<< Qualitative color scheme by Okabe and Ito
}

\DeclareOption*{\PackageWarning{colorblind}{Unknown '\CurrentOption'}}
\ProcessOptions\relax

\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.
	\definecolor{blue}{RGB/cmyk}{68,119,170/0.60000,0.30000,0.00000,0.33333}
	\definecolor{cyan}{RGB/cmyk}{102,204,238/0.57143,0.14286,0.00000,0.06667}
	\definecolor{green}{RGB/cmyk}{34,136,51/0.75000,0.00000,0.62500,0.46667}
	\definecolor{yellow}{RGB/cmyk}{204,187,68/0.00000,0.08333,0.66667,0.20000}
	\definecolor{red}{RGB/cmyk}{238,102,119/0.00000,0.57143,0.50000,0.06667}
	\definecolor{violet}{RGB/cmyk}{170,51,119/0.00000,0.70000,0.30000,0.33333}
	\definecolor{gray}{RGB/cmyk}{187,187,187/0.00000,0.00000,0.00000,0.26667}
	\definecolor{orange}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{brown}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{darkgray}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{lightgray}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{lime}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{magenta}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{olive}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{pink}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{purple}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}
	\definecolor{teal}{RGB/cmyk}{0,0,0/0.00000,0.00000,0.00000,1.00000}

	% Wrap the color command to check if any of the colors are used that are
	% redefined to black. If that is the case, issue a warning
	\let\origcolor\color
	\renewcommand{\color}[2][]{%
	\@for\c:={orange,brown,darkgray,lightgray,lime,magenta,olive,pink,purple,teal}\do{%
		\ifthenelse{\equal{#2}{\c}}%
		{\PackageWarning{colorblind}{#2 is redefined to black and should not be used!}}
		{}%
	}%
	\if\relax\detokenize{#1}\relax
	\origcolor{#2}%
	\else
	\origcolor[#1]{#2}%
	\fi
	}
\fi

% 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
