\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Color}[2025-07-09]

\RequirePackage{ifthen}

\newboolean{colorIsDarkMode}
\setboolean{colorIsDarkMode}{false}

\DeclareOption{darkmode}{
	\setboolean{colorIsDarkMode}{true}
}
\ProcessOptions\relax

% Color import and definition
\RequirePackage{xcolor}

\ifthenelse{\boolean{colorIsDarkMode}}{
	\pagecolor[rgb]{0.2,0.2,0.2}
	\color[rgb]{0.9,0.9,0.9}

	\definecolor{pageColor}{rgb}{0.2,0.2,0.2}
	\definecolor{paleGray}{rgb}{0.3,0.3,0.3}

	\definecolor{PrimeBlue}{RGB}{149, 164, 237}
	\definecolor{PrimePaleBlue}{RGB}{35, 39, 56}
}{
	\colorlet{pageColor}{white}
	\colorlet{paleGray}{gray!10}

	\definecolor{PrimeBlue}{RGB}{25,45,145}
	\definecolor{PrimePaleBlue}{RGB}{233,236,251}
}

\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118}
\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0}

\RequirePackage{PrimeTeX/packages/Layout}

\newcommand{\boxedcolor}[3][white]{%
	\providelength[\fboxsep]{\fboxsepdefault}%
	\setlength{\fboxsep}{2pt}%
	\fcolorbox{black}{#2}{\textcolor{#1}{#3}}%
	\setlength{\fboxsep}{\fboxsepdefault}%
}

\providelength[12.3599pt]{\warningboxsizeoffset}
\newcommand{\warningbox}[2][\textwidth - \warningboxsizeoffset]{%
	\noindent%
	\fcolorbox{WarningBoxFGColor}{WarningBoxBGColor}{%
		\noindent%
		\begin{minipage}{#1}%
			\raggedbottom%
			#2%
		\end{minipage}%
	}%
}