summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-09-02 19:49:01 +0000
committerKarl Berry <karl@freefriends.org>2022-09-02 19:49:01 +0000
commit4234e0418cef3adb71f27ea52a5d580c25774b8e (patch)
treee19b3e89d54ce3239836e624012bd20a87f250d9 /Master/texmf-dist/tex
parent8faa11b8c020ab20e6f4525b4952ac65827288a6 (diff)
darkmode (2sep22)
git-svn-id: svn://tug.org/texlive/trunk@64271 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/darkmode/darkmode.sty80
1 files changed, 80 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/darkmode/darkmode.sty b/Master/texmf-dist/tex/latex/darkmode/darkmode.sty
new file mode 100644
index 00000000000..a4841f8a889
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/darkmode/darkmode.sty
@@ -0,0 +1,80 @@
+%%
+%% This is file `darkmode.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% darkmode.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2022 by Ruben Deisenroth <rdeisenroth@gmail.com>
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\RequirePackage{expl3,l3keys2e}
+\ProvidesExplPackage {darkmode} {2022-09-01} {1.0.1}
+{Provide general dark mode support for any LaTeX document.}
+
+\RequirePackage{xcolor,pagecolor}
+\keys_define:nn {darkmode} {
+ enable .bool_gset:N = \g_@@_dark_mode_bool,
+ enable .initial:n = false,
+ enable .default:n = true,
+ defaulthook .bool_gset:N = \g_@@_dark_mode_hook_bool,
+ defaulthook .initial:n = true,
+ defaulthook .default:n = true,
+ nodefaulthook .meta:n = {defaulthook=false},
+}
+\ProcessKeysOptions{darkmode}
+
+\prg_new_conditional:Nnn \__darkmode_if_dark_mode: {T,F,TF} {
+ \bool_if:NTF \g_@@_dark_mode_bool
+ {\prg_return_true:}
+ {\prg_return_false:}
+}
+\cs_set_eq:NN\IfDarkModeT \__darkmode_if_dark_mode:T
+\cs_set_eq:NN\IfDarkModeF \__darkmode_if_dark_mode:F
+\cs_set_eq:NN\IfDarkModeTF \__darkmode_if_dark_mode:TF
+\definecolor{darkmode@anthrazitgrau}{HTML}{293133}
+\colorlet{fgcolor}{.}
+\DeclareDocumentCommand{\@darkmode@set@enabled}{}{
+ \bool_set_true:c {g_@@_dark_mode_bool}
+}
+\DeclareDocumentCommand{\@darkmode@on@enable}{}{
+ \pagecolor{darkmode@anthrazitgrau}
+ \color{white}
+ \selectcolormodel{RGB}
+ \colorlet{fgcolor}{.}
+}
+\DeclareDocumentCommand{\enabledarkmode}{}{
+ \@darkmode@set@enabled
+ \bool_if:cT {g_@@_dark_mode_hook_bool} {\@darkmode@on@enable}
+}
+\DeclareDocumentCommand{\@darkmode@set@disabled}{}{
+ \bool_set_false:c {g_@@_dark_mode_bool}
+}
+\DeclareDocumentCommand{\@darkmode@on@disable}{}{
+ \pagecolor{white}
+ \color{black}
+ \colorlet{fgcolor}{.}
+}
+\DeclareDocumentCommand{\disabledarkmode}{}{
+ \@darkmode@set@disabled
+ \bool_if:cT {g_@@_dark_mode_hook_bool} {\@darkmode@on@disable}
+}
+\DeclareDocumentCommand{\__darkmode_update_from_bool}{}{
+ \IfDarkModeTF{\enabledarkmode}{\disabledarkmode}
+}
+\__darkmode_update_from_bool
+\endinput
+%%
+%% End of file `darkmode.sty'.