Files
PrimeTeX/packages/Color.sty
2025-08-29 23:40:25 -05:00

186 lines
4.5 KiB
TeX

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Color}[2025-07-09]
\RequirePackage{ifthen}
% Color import and definition
\RequirePackage{xcolor}
% Split Complementary Color Scheme
% Primary Color: Blue
% Secondary Colors: Orange, Teal
% Triadic Color Scheme
% Primary Color: Blue
% Secondary Colors: Red, Green
% Tetradic Color Schemes
% Primary Color: Blue
% Secondary Colors 1: Red, Yellow, Teal
% Secondary Colors 2: Green, Yellow, Purple
% Square Color Scheme
% Primary Color: Blue
% Secondary Colors: Yellow, Mint, Pink
\definecolorset{HTML}{Prime}{}{% _Relationship to Base Color_
Gray, 4d505d;% #474c63 Saturation -> 9%
Yellow, 917d19;% #917d19 Complementary
Lime, 699119;% #699119 Split complementary
Green, 2d9119;% #2d9119 Triadic/Tetradic 2
Mint, 199141;% #199141 Square
Teal, 19917d;% #19917d Tetradic 1
Aqua, 196991;% #196991 Analogous
Blue, 192d91;% #192d91 *Basis of all other colors*
Violet, 411991;% #411991 Analogous
Purple, 7d1991;% #7d1991 Tetradic 2
Pink, 911969;% #911969 Square
Red, 91192d;% #91192d Triadic/Tetradic 1
Orange, 914119 % #914119 Split complementary
}
% Lightness ≈ 18%
\definecolorset{HTML}{PrimeDark}{}{% _Hue Shift_
Gray, 292b32;% #292b32 0°
Yellow, 4e430d;% #4e430d 180°
Lime, 394e0d;% #394e0d -150°
Green, 184e0d;% #184e0d -120°
Mint, 0d4e23;% #0d4e23 -90°
Teal, 0d4e43;% #0d4e43 -60°
Aqua, 0d394e;% #0d394e -30°
Blue, 0d184e;% #0d184e 0°
Violet, 220d4e;% #220d4e +30°
Purple, 430d4e;% #430d4e +60°
Pink, 4e0d39;% #4e0d39 +90°
Red, 4e0d18;% #4e0d18 +120°
Orange, 4e230d % #4e230d +150°
}
% Lightness ≈ 49%
\definecolorset{HTML}{PrimeBright}{}{%
Gray, 717588;% #717588
Yellow, d4b725;% #d4b725
Lime, 9ad425;% #9ad425
Green, 42d425;% #42d425
Mint, 25d460;% #25d460
Teal, 25d4b7;% #25d4b7
Aqua, 259ad4;% #259ad4
Blue, 2542d4;% #2542d4
Violet, 6025d4;% #6025d4
Purple, b825d4;% #b825d4
Pink, d4259a;% #d4259a
Red, d42542;% #d42542
Orange, d46025 % #d46025
}
% Lightness ≈ 64%
\definecolorset{HTML}{PrimeLight}{}{%
Gray, 9b9eac;% #9b9eac
Yellow, e4d063;% #e4d063
Lime, b8e463;% #b8e463
Green, 78e463;% #78e463
Mint, 63e48f;% #63e48f
Teal, 63e4cf;% #63e4cf
Aqua, 63b9e4;% #63b9e4
Blue, 6378e4;% #6378e4
Violet, 8f63e4;% #8f63e4
Purple, d063e4;% #d063e4
Pink, e463b8;% #e463b8
Red, e46378;% #e46378
Orange, e48f63 % #e48f63
}
% Lightness ≈ 64%
\definecolorset{HTML}{PrimePastel}{}{%
Gray, c6c8d0;% #c6c8d0
Yellow, f0e4a6;% #f0e4a6
Lime, d7f0a6;% #d7f0a6
Green, b2f0a6;% #b2f0a6
Mint, a6f0bf;% #a6f0bf
Teal, a6f0e4;% #a6f0e4
Aqua, a6d7f0;% #a6d7f0
Blue, a6b2f0;% #a6b2f0
Violet, bfa6f0;% #bfa6f0
Purple, e4a6f0;% #e4a6f0
Pink, f0a6d7;% #f0a6d7
Red, f0a6b2;% #f0a6b2
Orange, f0bfa6 % #f0bfa6
}
% Lightness ≈ 95%
\definecolorset{HTML}{PrimePale}{}{%
Gray, f1f1f3;% #f1f1f3
Yellow, fbf8e9;% #fbf8e9
Lime, f5fbe9;% #f5fbe9
Green, ecfbe9;% #ecfbe9
Mint, e9fbef;% #e9fbef
Teal, e9fbf8;% #e9fbf8
Aqua, e9f5fb;% #e9f5fb
Blue, e9ecfb;% #e9ecfb
Violet, efe9fb;% #efe9fb
Purple, f8e9fb;% #f8e9fb
Pink, fbe9f5;% #fbe9f5
Red, fbe9ec;% #fbe9ec
Orange, fbefe9 % #fbefe9
}
\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}{%
\setlength{\fboxrule}{0.0pt}% Temporarily set \fboxrule and \fboxsep.
\setlength{\fboxsep}{1.5pt}%
\fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}%
}