科技报告配色统一为幻灯片同一套海大标准色 #5

改前用的是 xcolor 通用色,跟海大无关:notebox 用 NavyBlue、importantbox
用 Orange、代码关键字纯蓝 rgb(0,0,1)、注释纯绿、代码标题 violet、水印纯灰。
同一个学校两个模板的「蓝」和「红」不是一回事。

新增 cls/color.cls 作为唯一配色入口:
- 10 个基色与 幻灯片/theme/beamercolorthemeOUCSlide.sty 逐值相同
  (前 7 个是官方 2021 版 VI 标准色,后 3 个是幻灯片补充的第三色)
- 8 个语义词别名(oucprimary / oucaccent / oucinfo / oucalert /
  ouccaption / oucrule / ouclink / oucmuted),按语义引用而非色名,
  将来调色只改一行
- 代码配色从标准色派生:关键字→海大蓝、注释→苍松绿、
  字符串→海大红、类型→海大天蓝、边框→专银

各文件改为引用语义色,不再硬写 RGB:
- boxes.cls:notebox NavyBlue→oucinfo,importantbox Orange→oucalert
- code.cls:删掉本地 5 个 definecolor;bashstyle NavyBlue→oucblue;
  bashoutputstyle black!10→codecolorbg + 专银线;行号 gray→oucmuted;
  代码标题 violet→ouccaption
- hyperref.cls:硬写 black→ouclink
- setting.tex:水印纯灰→海大蓝 4%(原 Lightness 会强制切 gray 模型覆盖颜色,已去掉)
- report.cls:加 \input{cls/color.cls},必须有在 boxes/code 之前

有意保持中性的两处(已在注释里说明理由):
- shellbox / invertedshellbox:终端反白块语义就该是黑底,
  换成蓝会变成「强调块」抢正文注意力
- 页眉线:彩色页眉线会跟正文海大蓝标题抢视觉层级,仍 0.5pt 黑

验证:错误 0,10 页,Overfull 0,Underfull 保持既有 2 条;
PDF 逐 span 提取文字色只剩 #004098 / #C81528 / #000000,
矢量填充与描边全部落在标准色内,无 NavyBlue / Orange / violet 残留。
This commit is contained in:
2026-10-26 22:50:19 +08:00
parent 62649ef6d6
commit c69f4461dc
8 changed files with 137 additions and 51 deletions
+16 -15
View File
@@ -4,11 +4,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{listings,verbatim}
\definecolor{codecolorkeywords}{rgb}{0,0,1}
\definecolor{codecolorcomments}{rgb}{0,0.5,0}
\definecolor{codecolorxmlcomments}{rgb}{0.5,0.5,0.5}
\definecolor{codecolorstrings}{rgb}{0.64,0.08,0.08}
\definecolor{codecolortypes}{rgb}{0.17,0.57,0.68}
% 代码配色不在这里定义,统一来自 cls/color.cls:
% codecolorkeywords = 海大蓝 codecolorcomments = 苍松绿
% codecolorstrings = 海大红 codecolortypes = 海大天蓝
% codecolorframe = 专银 codecolorbg = 极浅中性底
\lstdefinelanguage{JavaScript}{
keywords={do, if, in, for, let, new, try, var, case, else, enum, eval, null, this, true, void, with, await, break, catch, class, const, false, super, throw, while, yield, delete, export, import, public, return, static, switch, typeof, default, extends, finally, package, private, continue, debugger, function, arguments, interface, protected, implements, instanceof},
@@ -44,16 +43,16 @@
framesep=5pt,
framerule=.5pt,
framexleftmargin=10pt,
rulecolor=\color{black},
rulecolor=\color{codecolorframe},
abovecaptionskip=0pt,
belowcaptionskip=5pt,
aboveskip=5pt,
backgroundcolor=\color{black!5!white},
backgroundcolor=\color{codecolorbg},
% Code design
keywordstyle=\color{codecolorkeywords},
commentstyle=\color{codecolorcomments},
stringstyle=\color{codecolorstrings},
numberstyle=\small\color{gray},
numberstyle=\small\color{oucmuted},
breakatwhitespace=false,
breaklines=true,
captionpos=t,
@@ -74,9 +73,9 @@
}
\lstset{style=mystyle}
%% 命令行
%% 命令行(bash 示例):浅海大蓝底 + 粗左侧海大蓝竖线
\lstdefinestyle{bashstyle}{
backgroundcolor=\color{NavyBlue!10!white},
backgroundcolor=\color{oucblue!10!white},
basicstyle=\linespread{1.2}\ttfamily,
keepspaces=true,
numbers=none,
@@ -87,7 +86,7 @@
framexleftmargin=3pt,
framextopmargin=-5pt,
xleftmargin=10pt,
rulecolor=\color{NavyBlue},
rulecolor=\color{oucblue},
% Code
tabsize=4,
showspaces=false,
@@ -96,9 +95,11 @@
breaklines=true,
}
%% 命令行输出
%% 命令行输出:中性极浅底 + 专银左侧竖线
% 说明:输出是"机器吐出来的东西",语义上不该比命令更醒目,
% 所以颜色比 bashstyle 退一档,用专银而不是海大蓝。
\lstdefinestyle{bashoutputstyle}{
backgroundcolor=\color{black!10!white},
backgroundcolor=\color{codecolorbg},
basicstyle=\linespread{1.2}\ttfamily,
keepspaces=true,
numbers=none,
@@ -109,7 +110,7 @@
framexleftmargin=3pt,
framextopmargin=-5pt,
xleftmargin=10pt,
rulecolor=\color{black!70!white},
rulecolor=\color{codecolorframe},
% Code
tabsize=4,
showspaces=false,
@@ -124,6 +125,6 @@
%%\colorbox{black!20}{
%% \parbox{\textwidth}{#1#2\ttfamily#3}
%%}
\parbox{\textwidth}{\textcolor{violet}\faCode~\textcolor{violet}{#1#2}\hspace{.5em}\fzkai#3}
\parbox{\textwidth}{\textcolor{ouccaption}\faCode~\textcolor{ouccaption}{#1#2}\hspace{.5em}\fzkai#3}
}
\captionsetup[lstlisting]{format=codecaptionformat}