Expand and harmonize color sets.

This commit is contained in:
2025-08-29 12:56:36 -05:00
parent 9147415df7
commit fc3e8e2575
9 changed files with 188 additions and 71 deletions

View File

@@ -2,17 +2,13 @@
\RequirePackage{PrimeTeX/packages/Caption} \RequirePackage{PrimeTeX/packages/Caption}
\ifthenelse{\boolean{isDarkMode}\AND\boolean{isElectronic}}{ \RequirePackage{PrimeTeX/packages/Color}
\RequirePackage[darkmode]{PrimeTeX/packages/Color}
}{
\RequirePackage{PrimeTeX/packages/Color}
}
\RequirePackage{PrimeTeX/packages/CrossRef} \RequirePackage{PrimeTeX/packages/CrossRef}
\RequirePackage{PrimeTeX/packages/DocProperties} \RequirePackage{PrimeTeX/packages/DocProperties}
% Load graphicx before Fonts because the menukeys packages causes a conflict. % Load graphicx before Fonts because the menukeys package causes a conflict.
% Graphics package for including images % Graphics package for including images
\RequirePackage[final]{graphicx} \RequirePackage[final]{graphicx}

View File

@@ -9,24 +9,18 @@
\providelength{\boxoutpadding}[1em] \providelength{\boxoutpadding}[1em]
\providelength{\boxoutrule}[1pt] \providelength{\boxoutrule}[1pt]
\colorlet{BoxoutBGColor}{PrimePaleBlue}
\colorlet{BoxoutFGColor}{PrimeBlue}
\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118}
\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0}
\NewTblrEnviron{tblrBoxout} \NewTblrEnviron{tblrBoxout}
\SetTblrInner[tblrBoxout]{ \SetTblrInner[tblrBoxout]{
cells = {BoxoutBGColor}, cells = {boxoutBG},
hborder{1} = {belowspace=\boxoutpadding}, hborder{1} = {belowspace=\boxoutpadding},
hborder{Z} = {abovespace=\boxoutpadding}, hborder{Z} = {abovespace=\boxoutpadding},
hlines = {0pt,BoxoutBGColor}, hlines = {0pt,boxoutBG},
hline{1,Z} = {\boxoutrule,BoxoutFGColor}, hline{1,Z} = {\boxoutrule,boxoutFG},
%row{1} = {font={\bfseries\sbfamily}}, %row{1} = {font={\bfseries\sbfamily}},
vborder{1} = {rightspace=\boxoutpadding}, vborder{1} = {rightspace=\boxoutpadding},
vborder{Z} = {leftspace=\boxoutpadding}, vborder{Z} = {leftspace=\boxoutpadding},
vlines = {0pt,BoxoutBGColor}, vlines = {0pt,boxoutBG},
vline{1,Z} = {\boxoutrule,BoxoutFGColor}, vline{1,Z} = {\boxoutrule,boxoutFG},
} }
\NewDocumentEnvironment{@boxout}{ \NewDocumentEnvironment{@boxout}{
@@ -51,8 +45,8 @@
+b +b
}{% }{%
\ifthenelse{\equal{#4}{w}\OR\equal{#4}{W}}{% \ifthenelse{\equal{#4}{w}\OR\equal{#4}{W}}{%
\colorlet{BoxoutBGColor}{WarningBoxBGColor}% \colorlet{boxoutBG}{warningBG}%
\colorlet{BoxoutFGColor}{WarningBoxFGColor}% \colorlet{boxoutFG}{warningFG}%
}{}% }{}%
\IfBlankTF{#3}{% \IfBlankTF{#3}{%
\begin{@boxout}{#1}{#2}{}% \begin{@boxout}{#1}{#2}{}%
@@ -101,7 +95,7 @@
\NewDocumentEnvironment{WrapBoxout}{ \NewDocumentEnvironment{WrapBoxout}{
% position [l,r,i,o] % position [l,r,i,o]
O{O} O{o}
% offset % offset
O{\marparwidth} O{\marparwidth}
% width % width

View File

@@ -8,7 +8,7 @@
justification = Centering, justification = Centering,
font = { font = {
small, small,
color=PrimeBlue, color=caption,
}, },
} }

View File

@@ -3,44 +3,155 @@
\RequirePackage{ifthen} \RequirePackage{ifthen}
\newboolean{colorIsDarkMode}
\setboolean{colorIsDarkMode}{false}
\DeclareOption{darkmode}{
\setboolean{colorIsDarkMode}{true}
}
\ProcessOptions\relax
% Color import and definition % Color import and definition
\RequirePackage{xcolor} \RequirePackage{xcolor}
\ifthenelse{\boolean{colorIsDarkMode}}{ \definecolorset{HTML}{Prime}{}{%
\pagecolor[rgb]{0.2,0.2,0.2} Gray, 474c63;% #474c63 Blue, saturation -> 17%
\color[rgb]{0.9,0.9,0.9} Red, 91192d;% #91192d Tetradic
Orange, 914119;% #914119 Split complementary
\definecolor{PrimeBlue}{RGB}{149, 164, 237} Yellow, 917d19;% #917d19 Complementary
\definecolor{PrimePaleBlue}{RGB}{35, 39, 56} Lime, 699119;% #699119 Split complementary
Green, 2d9119;% #2d9119 Triadic
\definecolor{pageColor}{rgb}{0.2,0.2,0.2} Teal, 19917d;% #19917d Tetradic
\definecolor{textColor}{rgb}{0.9,0.9,0.9} Aqua, 196991;% #196991 Analogous
\definecolor{paleGray}{rgb}{0.3,0.3,0.3} Blue, 192d91;% #192d91 Basis of all other colors
}{ Purple, 411991;% #411991 Analogous
\definecolor{PrimeBlue}{RGB}{25,45,145} Pink, 911969 % #911969 Analogous of Red & Purple
\definecolor{PrimePaleBlue}{RGB}{233,236,251}
\colorlet{pageColor}{white}
\colorlet{textColor}{black}
\colorlet{paleGray}{gray!10}
} }
\colorlet{layoutColor}{PrimePaleBlue} % Lightness ≈ 18%
\definecolorset{HTML}{PrimeDark}{}{%
Gray, 262836;% #262836
Red, 4e0d18;% #4e0d18
Orange, 4e230d;% #4e230d
Yellow, 4e430d;% #4e430d
Lime, 394e0d;% #394e0d
Green, 184e0d;% #184e0d
Teal, 0d4e43;% #0d4e43
Aqua, 0d394e;% #0d394e
Blue, 0d184e;% #0d184e
Purple, 220d4e;% #220d4e
Pink, 4e0d39 % #4e0d39
}
\RequirePackage{PrimeTeX/packages/Layout} % Lightness ≈ 49%
\definecolorset{HTML}{PrimeBright}{}{%
Gray, 686f91;% #686f91
Red, d42542;% #d42542
Orange, d46025;% #d46025
Yellow, d4b725;% #d4b725
Lime, 9ad425;% #9ad425
Green, 42d425;% #42d425
Teal, 25d4b7;% #25d4b7
Aqua, 259ad4;% #259ad4
Blue, 2542d4;% #2542d4
Purple, 6025d4;% #6025d4
Pink, d4259a % #d4259a
}
\colorlet{boxedcoloroutline}{black} % Lightness ≈ 64%
\definecolorset{HTML}{PrimeLight}{}{%
Gray, 9499b3;% #9499b3
Red, e46378;% #e46378
Orange, e48f63;% #e48f63
Yellow, e4d063;% #e4d063
Lime, b8e463;% #b8e463
Green, 63e48f;% #63e48f
Teal, 63b8e4;% #63b8e4
Aqua, 63b9e4;% #63b9e4
Blue, 6378e4;% #6378e4
Purple, 8f63e4;% #8f63e4
Pink, e463b8 % #e463b8
}
% Lightness ≈ 64%
\definecolorset{HTML}{PrimePastel}{}{%
Gray, c2c5d4;% #c2c5d4
Red, f0a6b2;% #f0a6b2
Orange, f0bfa6;% #f0bfa6
Yellow, f0e4a6;% #f0e4a6
Lime, d7f0a6;% #d7f0a6
Green, b2f0a6;% #b2f0a6
Teal, a6f0e4;% #a6f0e4
Aqua, a6d7f0;% #a6d7f0
Blue, a6b2f0;% #a6b2f0
Purple, bfa6f0;% #bfa6f0
Pink, f0a6d7 % #f0a6d7
}
% Lightness ≈ 95%
\definecolorset{HTML}{PrimePale}{}{%
Gray, eff0f5;% #eff0f5
Red, fbe9ec;% #fbe9ec
Orange, fbefe9;% #fbefe9
Yellow, fbf8e9;% #fbf8e9
Lime, f5fbe9;% #f5fbe9
Green, ecfbe9;% #ecfbe9
Teal, e9fbf8;% #e9fbf8
Aqua, e9f5fb;% #e9f5fb
Blue, e9ecfb;% #e9ecfb
Purple, efe9fb;% #efe9fb
Pink, fbe9f5 % #fbe9f5
}
\ifthenelse{\boolean{isDarkMode}\AND\boolean{isElectronic}}{
% Page and text colors.
\colorlet{page}{PrimeDarkGray}
\colorlet{text}{PrimePastelGray}
\colorlet{caption}{PrimePastelBlue}
\colorlet{marginText}{PrimePastelBlue}
\colorlet{link}{PrimeLightBlue}
% Banded table rows.
\colorlet{bandedRow}{PrimeGray}
% Boxout colors.
\colorlet{boxoutBG}{PrimeDarkBlue}
\colorlet{boxoutFG}{PrimeLightBlue}
% Warning Box colors.
\colorlet{warningBG}{PrimeDarkOrange}
\colorlet{warningFG}{PrimeOrange}
% Layout preview frame color.
\colorlet{layout}{PrimeGray}
}{
% Page and text colors.
\colorlet{page}{white}
\colorlet{text}{black}
\colorlet{caption}{PrimeDarkBlue}
\colorlet{marginText}{PrimeDarkBlue}
\colorlet{link}{PrimeBlue}
% Banded table rows.
\colorlet{bandedRow}{PrimePaleGray}
% Boxout colors.
\colorlet{boxoutBG}{PrimePaleBlue}
\colorlet{boxoutFG}{PrimeBlue}
% Warning Box colors.
\colorlet{warningBG}{PrimePastelOrange}
\colorlet{warningFG}{PrimeBrightOrange}
% Layout preview frame color.
\colorlet{layout}{PrimePaleBlue}
}
\pagecolor{page}
\color{text}
\colorlet{boxedcoloroutline}{text}
\NewDocumentCommand{\boxedcolor}{O{\rule{0pt}{1ex}\rule{1ex}{0pt}} m m}{% \NewDocumentCommand{\boxedcolor}{O{\rule{0pt}{1ex}\rule{1ex}{0pt}} m m}{%
{\setlength{\fboxrule}{0.2pt}% Temporarily set \fboxrule and \fboxsep. \setlength{\fboxrule}{0.0pt}% Temporarily set \fboxrule and \fboxsep.
\setlength{\fboxsep}{1pt}% \setlength{\fboxsep}{1.5pt}%
\fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}}% \fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}%
} }

View File

@@ -34,20 +34,21 @@
% Redefine the commands geometry uses to draw the page frame to customize the % Redefine the commands geometry uses to draw the page frame to customize the
% color. % color.
\renewcommand{\Gm@vrule}{\color{layoutColor}\vrule width 0.2pt height\textheight depth\z@} \renewcommand{\Gm@vrule}{\color{layout}\vrule width 0.2pt height\textheight depth\z@}
\renewcommand{\Gm@hrule}{\color{layoutColor}\hrule height 0.2pt depth\z@ width\textwidth} \renewcommand{\Gm@hrule}{\color{layout}\hrule height 0.2pt depth\z@ width\textwidth}
\renewcommand{\Gm@hruled}{\color{layoutColor}\hrule height\z@ depth0.2pt width\textwidth} \renewcommand{\Gm@hruled}{\color{layout}\hrule height\z@ depth0.2pt width\textwidth}
% Suppress "Underfull \hbox" infos. % Suppress "Underfull \hbox" infos.
\hbadness=10000 \hbadness=10000
\ifthenelse{\boolean{isDraft}}{ \ifthenelse{\boolean{isDraft}}{
\geometry{showframe} \geometry{showframe}
\hfuzz = 2.0pt \hfuzz = 0.5pt
\vfuzz = 0.0pt
}{ }{
% Suppress small overfull infos. % Suppress small overfull infos.
\hfuzz = 6.0pt \hfuzz = 6.0pt
\vfuzz = 0.0pt \vfuzz = 8.0pt
} }
\ifthenelse{\boolean{isElectronic}}{ \ifthenelse{\boolean{isElectronic}}{
@@ -63,15 +64,23 @@
\providelength{\contentwidth}[\textwidth + \marparwidth] \providelength{\contentwidth}[\textwidth + \marparwidth]
\RequirePackage[ \RequirePackage[
debug,
balanced, balanced,
emergencystretch = 3em,
max-cost = 25000,
widowpenalty = 1000,
orphanpenalty = 1000,
brokenpenalty = 10000,
nobreak = keep,
]{lua-widow-control} ]{lua-widow-control}
\ifthenelse{\boolean{isDraft}}{ \ifthenelse{\boolean{isDraft}}{
\lwcsetup{draft=false,showcolours=true} \lwcsetup{showcolours=true,}
}{} }{}
% Paragraph formatting. % Paragraph formatting.
\setlength{\parindent}{0pt} \setlength{\parindent}{0pt}
\setlength{\parskip}{\medskipamount} \setlength{\parskip}{6pt plus 3pt minus 3pt}
% Float Page Configuration % Float Page Configuration
\renewcommand{\topfraction}{0.9} % max fraction of floats at top \renewcommand{\topfraction}{0.9} % max fraction of floats at top
@@ -130,9 +139,9 @@
\begin{SmartAdjustWidth}{-#2}{-#2 * \real{#4}}% adjustwidth(*) \begin{SmartAdjustWidth}{-#2}{-#2 * \real{#4}}% adjustwidth(*)
\begin{minipage}{\linewidth}%{#2 * (#4 + 1) + \textwidth}% \begin{minipage}{\linewidth}%{#2 * (#4 + 1) + \textwidth}%
\ifthenelse{\boolean{isDraft}}{% \ifthenelse{\boolean{isDraft}}{%
{\color{layoutColor}\rule{\textwidth}{1pt}\zws}% {\color{layout}\rule{\textwidth}{1pt}\zws}%
#5% #5%
%{\color{layoutColor}\rule{\textwidth}{1pt}}% %{\color{layout}\rule{\textwidth}{1pt}}%
}{% }{%
#5% #5%
}% }%

View File

@@ -16,11 +16,11 @@
\ifthenelse{\boolean{isElectronic}}{ \ifthenelse{\boolean{isElectronic}}{
\hypersetup{ \hypersetup{
allcolors = PrimeBlue, allcolors = link,
} }
}{ }{
\hypersetup{ \hypersetup{
allcolors = textColor, allcolors = text,
pdfduplex = DuplexFlipLongEdge, pdfduplex = DuplexFlipLongEdge,
pdfpagelayout = TwoPageRight, pdfpagelayout = TwoPageRight,
} }

View File

@@ -1,9 +1,6 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Marginalia}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/Marginalia}[2025-07-09]
% Marginalia formatting.
\colorlet{marginTextColor}{PrimeBlue}
% Allow hyphenation in narrow margin paragraphs. % Allow hyphenation in narrow margin paragraphs.
\RequirePackage{ragged2e} \RequirePackage{ragged2e}
@@ -20,8 +17,8 @@
- \textheight - \textheight
}, },
yshift = {7pt}, % Just a magic number that lines up margin notes with their reference. yshift = {7pt}, % Just a magic number that lines up margin notes with their reference.
style recto outer = {\RaggedRight\small\color{marginTextColor}}, style recto outer = {\RaggedRight\small\color{marginText}},
style verso outer = {\RaggedLeft\small\color{marginTextColor}}, style verso outer = {\RaggedLeft\small\color{marginText}},
} }
% Put a glossary definition in a margin paragraph. % Put a glossary definition in a margin paragraph.

View File

@@ -22,13 +22,13 @@
\NewTblrEnviron{tblrBanded} \NewTblrEnviron{tblrBanded}
\SetTblrInner[tblrBanded]{ \SetTblrInner[tblrBanded]{
rowhead = 1, rowhead = 1,
row{odd} = {paleGray}, row{odd} = {bandedRow},
row{1} = {bg=pageColor, font=\bfseries}, row{1} = {bg=page, font=\bfseries},
hline{1,Z} = {0.6pt}, hline{1,Z} = {0.6pt},
hline{2} = {0.4pt}, hline{2} = {0.4pt},
} }
\NewTblrTableCommand{\midtitle}[1][pageColor]{ \NewTblrTableCommand{\midtitle}[1][page]{
\SetCell[c=2]{ \SetCell[c=2]{
c, c,
bg = #1, bg = #1,

View File

@@ -19,8 +19,18 @@
\chaptertitlename{} \thechapter \chaptertitlename{} \thechapter
}{20pt}{\Huge} }{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{36pt plus 12pt minus 12pt}{24pt plus 8pt minus 8pt}
\titleformat*{\section}{\sbfamily\Large} \titleformat*{\section}{\sbfamily\Large}
\titlespacing{\section}{0pt}{16pt plus 5pt minus 5pt}{14pt plus 4pt minus 4pt}
\titleformat*{\subsection}{\sbfamily\large} \titleformat*{\subsection}{\sbfamily\large}
\titlespacing{\subsection}{0pt}{14pt plus 4pt minus 4pt}{12pt plus 4pt minus 4pt}
\titleformat*{\subsubsection}{\sbfamily} \titleformat*{\subsubsection}{\sbfamily}
\titleformat*{\paragraph}{\sbfamily} \titleformat*{\paragraph}{\sbfamily}
\titleformat*{\subparagraph}{\sbfamily} \titleformat*{\subparagraph}{\sbfamily}