From 4355494602c138aa16cf1f090370d84765563330 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 28 May 2020 22:11:12 +0200 Subject: [PATCH] Modularize colors --- jishoScrape/src/textFiltration.js | 2 +- kanjiLib.tex | 25 ++++++++++++++----------- main.tex | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/jishoScrape/src/textFiltration.js b/jishoScrape/src/textFiltration.js index eeac0db..ff3530e 100644 --- a/jishoScrape/src/textFiltration.js +++ b/jishoScrape/src/textFiltration.js @@ -1,4 +1,4 @@ -const yomiBrackets = ['\\textbf{\\textcolor{myGreen!80!black}{', '}}']; +const yomiBrackets = ['\\textbf{\\textcolor{kanjiColor!80!black}{', '}}']; const yomiConnector = '、 '; const yomiDash = '—'; diff --git a/kanjiLib.tex b/kanjiLib.tex index 7ee69db..7e95724 100644 --- a/kanjiLib.tex +++ b/kanjiLib.tex @@ -3,7 +3,10 @@ \usepackage{anyfontsize} \usepackage{tikz} -\definecolor{myGreen}{RGB}{72, 194, 78} +\definecolor{kanjiColor}{RGB}{72, 194, 78} +\colorlet{kunyomiColor}{blue} +\colorlet{onyomiColor}{red} +\colorlet{meaningColor}{black} % ---------------------------------------------------------------------------- % % JLPT Section % @@ -54,7 +57,7 @@ \begin{center} \resizebox{\textwidth}{!}{ \begin{tikzpicture} - \fill[rounded corners=2pt, fill=myGreen, draw=black] (0,0) rectangle (1,1); + \fill[rounded corners=2pt, fill=kanjiColor, draw=black] (0,0) rectangle (1,1); \draw (0.5,0.23) node[white, anchor=base, scale=2]{#1}; \end{tikzpicture} } @@ -101,7 +104,7 @@ tcbox width=auto limited, capture=hbox, enhanced, - colback=black!20, + colback=meaningColor!20, left=15pt, right=15pt, top=15pt, @@ -110,7 +113,7 @@ outer arc=0pt, attach boxed title to top center={yshift=-12pt, yshifttext=-6pt}, title={\fontsize{15}{20}\textcolor{white}{\textbf{意味}}}, - colbacktitle=black!60, + colbacktitle=meaningColor!60, boxed title style={arc=0pt, outer arc=0pt} } @@ -129,14 +132,14 @@ \newtcolorbox{kunyomiBox}{ enhanced, attach boxed title to top left={yshift=-12pt,xshift=10pt}, - colback=blue!20, - colframe=blue!60, + colback=kunyomiColor!20, + colframe=kunyomiColor!60, left=15pt, right=15pt, top=15pt, bottom=5pt, title={\fontsize{15}{20}\textcolor{white}{\textbf{訓読み}}}, - colbacktitle=blue!60, + colbacktitle=kunyomiColor!60, width=\textwidth } @@ -150,21 +153,21 @@ \newtcolorbox{onyomiBox}{ enhanced, attach boxed title to top left={yshift=-12pt,xshift=10pt}, - colback=red!20, - colframe=red!60, + colback=onyomiColor!20, + colframe=onyomiColor!60, left=15pt, right=15pt, top=15pt, bottom=5pt, title={\fontsize{15}{20}\textcolor{white}{\textbf{音読み}}}, - colbacktitle=red!60, + colbacktitle=onyomiColor!60, width=\textwidth, } \newcommand{\onyomi}[1]{ \begin{onyomiBox} \fontsize{15}{20} - \textbf{\textcolor{myGreen!80!black}{#1}} + \textbf{\textcolor{kanjiColor!80!black}{#1}} \end{onyomiBox} \vspace{0.5cm} } diff --git a/main.tex b/main.tex index b2f8785..213700a 100644 --- a/main.tex +++ b/main.tex @@ -39,7 +39,7 @@ % Kanji table settings that should not affect the titlepage \renewcommand{\arraystretch}{2} - \rowcolors{1}{white}{myGreen!30} + \rowcolors{1}{white}{kanjiColor!30} \break