%% CAUTION: The macros specified in this file 
%% must work in conjunction with the macros
%% specified in majixed.tex and/or plante.tex.
%% The files must be input simultaneously.

\catcode`@=11
\@ifpackageloaded{xcolor}{}{\usepackage{xcolor}}

%% Light & dark mode switch
\let\daynight\@firstoftwo
\def\dayswitch{\let\daynight\@firstoftwo}
\def\nightswitch{\let\daynight\@secondoftwo}

\edef\hour{\the\numexpr\time/60}

\ifnum\hour<6 \nightswitch \else \ifnum\hour>18 \nightswitch \fi \fi

\protected\def\colors{%
	\daynight{%% Day colors
		\definecolor{sg}{RGB}{23, 95, 34}%
		\definecolor{sy}{RGB}{211, 105, 43}%
		\definecolor{sr}{RGB}{198, 71, 77}%
		\definecolor{sc}{RGB}{255, 255, 255}%
		\definecolor{fcs}{RGB}{52, 84, 138}%
		\definecolor{fta}{RGB}{193, 95, 38}%
		\definecolor{fpa}{RGB}{143, 94, 21}%
		\definecolor{fif}{RGB}{140, 67, 81}%
		\definecolor{fdf}{RGB}{15, 75, 110}%
		\definecolor{fnv}{RGB}{51, 99, 92}%
		\definecolor{fnw}{RGB}{90, 74, 120}%
		\definecolor{ffl}{RGB}{22, 103, 117}%
		\definecolor{fgp}{RGB}{72, 94, 48}%
		\definecolor{ts}{RGB}{189, 191, 197}%
		\definecolor{tc}{RGB}{150, 153, 163}%
		\definecolor{bg}{RGB}{213, 214, 219}%
		\definecolor{bt}{RGB}{52, 59, 90}%
		}{%% Night colors
		\definecolor{sg}{RGB}{86, 174, 90}%
		\definecolor{sy}{RGB}{233, 161, 94}%
		\definecolor{sr}{RGB}{238, 130, 119}%
		\definecolor{sc}{RGB}{0, 0, 0}%
		\definecolor{fcs}{RGB}{122, 162, 247}%
		\definecolor{fta}{RGB}{255, 158, 100}%
		\definecolor{fpa}{RGB}{224, 175, 104}%
		\definecolor{fif}{RGB}{247, 118, 142}%
		\definecolor{fdf}{RGB}{125, 207, 255}%
		\definecolor{fnv}{RGB}{115, 218, 202}%
		\definecolor{fnw}{RGB}{187, 154, 247}%
		\definecolor{ffl}{RGB}{180, 249, 248}%
		\definecolor{fgp}{RGB}{158, 206, 106}%
		\definecolor{ts}{RGB}{48, 53, 77}%
		\definecolor{tc}{RGB}{86, 95, 137}%
		\definecolor{bg}{RGB}{26, 27, 38}%
		\definecolor{bt}{RGB}{192, 202, 245}%
		}\colorsuse
}%
\protected\def\colorsuse{\color{bt}\pagecolor{bg}} \colors
\protected\def\daycolors{\dayswitch\colors} \protected\def\nightcolors{\nightswitch\colors}
\def\color@reset#1{\iappto\colors{#1}#1}