From 308bb1108f05d9f3b498559bb2037cbd8cefb156 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 28 Jul 2021 20:48:13 +0000 Subject: palette (28jul21) git-svn-id: svn://tug.org/texlive/trunk@60104 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/palette/colorpalette.sty | 81 ++++++++++++++++++++++ .../texmf-dist/tex/latex/palette/symbolpalette.sty | 67 ++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/palette/colorpalette.sty create mode 100644 Master/texmf-dist/tex/latex/palette/symbolpalette.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/palette/colorpalette.sty b/Master/texmf-dist/tex/latex/palette/colorpalette.sty new file mode 100644 index 00000000000..cdf3e2265a3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/palette/colorpalette.sty @@ -0,0 +1,81 @@ +%% +%% This is file `colorpalette.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% palette.dtx (with options: `color') +%% +%% This is a generated file. +%% +%% Copyright (C) 2021 Dennis Chen +%% +%% This work may be distributed and/or modified under +%% the conditions the LaTeX Project Public License (LPPL), +%% either version 1.3 of this license or (at your option) +%% any later version. The latest version of this license +%% can be found 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. +%% +%% To produce the documentation, run palette.dtx through pdflatex. +%% + + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{colorpalette} +[2021/07/27 v1.0.0 Create palettes for colors and symbols] +\RequirePackage{xcolor} +\RequirePackage{macrolist} +\newcommand\newpalettetheme[1]{ + \newlist{colorpalette@theme@#1@palettes} + \newlist{colorpalette@theme@#1@colors} +} +\newcommand\addcolortotheme[2]{ + \colorpalette@themecheck{#1} + \listadd{colorpalette@theme@#1@colors}{#2} +} +\newcommand\newpalette[2]{ + % Check that the theme exists + \colorpalette@themecheck{#1} + \listadd{colorpalette@theme@#1@palettes}{#2} +} +\newcommand\setpalettecolor[3]{ + \colorpalette@themecheck{#1} + \colorpalette@palettecheck{#1}{#2} + \colorpalette@colorcheck{#1}{#3} + \def\colorpalette@temp@themename{#1} + \def\colorpalette@temp@palettename{#2} + \def\colorpalette@temp@colorname{#3} + \colorpalette@setpalettecolor +} +\newcommand\colorpalette@setpalettecolor[2][HTML]{ + \definecolor{colorpalette@\colorpalette@temp@themename @\colorpalette@temp@palettename @\colorpalette@temp@colorname}{#1}{#2} +} +\newcommand\activepalette[2]{% + \colorpalette@themecheck{#1} + \colorpalette@palettecheck{#1}{#2} + \expandafter\def\csname colorpalette@#1@active\endcsname{#2}% +} +\newcommand\getcolor[2]{colorpalette@#1@\csname colorpalette@#1@active\endcsname @#2} +\newcommand\applycolor[2]{% + \colorpalette@themecheck{#1}% + \colorpalette@colorcheck{#1}{#2}% + \color{\getcolor{#1}{#2}}% +} +\newcommand\colorpalette@themecheck[1]{\listexists{colorpalette@theme@#1@palettes}{}{\colorpalette@error@theme{#1}}} +\newcommand\colorpalette@palettecheck[2]{\listcontains{colorpalette@theme@#1@palettes}{#2}{}{\colorpalette@error@palette{#1}{#2}}} +\newcommand\colorpalette@colorcheck[2]{\listcontains{colorpalette@theme@#1@colors}{#2}{}{\colorpalette@error@color{#1}{#2}}} +\newcommand\colorpalette@error@theme[1]{\PackageError{colorpalette}{The theme `#1' passed in is not defined}{}} +\newcommand\colorpalette@error@palette[2]{\PackageError{colorpalette}{The palette `#2' passed in is not a defined palette of theme `#1'}{}} +\newcommand\colorpalette@error@color[2]{\PackageError{colorpalette}{The color `#2' passed in is not a defined color of theme `#1'}{}} +%% +%% This package consists of the file palette.dtx, +%% and the generated files colorpalette.sty, +%% symbolpalette.sty, +%% palette.pdf. +%% +%% End of file `colorpalette.sty'. diff --git a/Master/texmf-dist/tex/latex/palette/symbolpalette.sty b/Master/texmf-dist/tex/latex/palette/symbolpalette.sty new file mode 100644 index 00000000000..170612dd207 --- /dev/null +++ b/Master/texmf-dist/tex/latex/palette/symbolpalette.sty @@ -0,0 +1,67 @@ +%% +%% This is file `symbolpalette.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% palette.dtx (with options: `symbol') +%% +%% This is a generated file. +%% +%% Copyright (C) 2021 Dennis Chen +%% +%% This work may be distributed and/or modified under +%% the conditions the LaTeX Project Public License (LPPL), +%% either version 1.3 of this license or (at your option) +%% any later version. The latest version of this license +%% can be found 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. +%% +%% To produce the documentation, run palette.dtx through pdflatex. +%% + + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{symbolsuite} +[2021/07/27 v1.0.0 Create palettes for colors and symbols] +\RequirePackage{macrolist} +\newcommand\newsuitetheme[1]{ + \newlist{symbolsuite@theme@#1@suites} + \newlist{symbolsuite@theme@#1@symbols} +} +\newcommand\addsymboltotheme[2]{ + \symbolsuite@themecheck{#1} + \listadd{symbolsuite@theme@#1@symbols}{#2} +} +\newcommand\newsuite[2]{ + \symbolsuite@themecheck{#1} + \listadd{symbolsuite@theme@#1@suites}{#2} +} +\newcommand\setsuitesymbol[4]{\expandafter\def\csname symbolsuite@#1@#2@#3\endcsname{#4}} +\newcommand\activesuite[2]{ + \symbolsuite@themecheck{#1} + \symbolsuite@suitecheck{#1}{#2} + \expandafter\def\csname symbolsuite@#1@active\endcsname{#2} +} +\newcommand\printsymbol[2]{% + \symbolsuite@themecheck{#1}% + \symbolsuite@symbolcheck{#1}{#2}% + \csname symbolsuite@#1@\csname symbolsuite@#1@active\endcsname @#2\endcsname% +} +\newcommand\symbolsuite@themecheck[1]{\listexists{symbolsuite@theme@#1@suites}{}{\symbolsuite@error@theme{#1}}} +\newcommand\symbolsuite@suitecheck[2]{\listcontains{symbolsuite@theme@#1@suites}{#2}{}{\symbolsuite@error@suite{#1}{#2}}} +\newcommand\symbolsuite@symbolcheck[2]{\listcontains{symbolsuite@theme@#1@symbols}{#2}{}{\symbolsuite@error@symbol{#1}{#2}}} +\newcommand\symbolsuite@error@theme[1]{\PackageError{symbolsuite}{The theme `#1' passed in is not defined}{}} +\newcommand\symbolsuite@error@suite[2]{\PackageError{symbolsuite}{The suite `#2' passed in is not a defined suite of theme `#1'}{}} +\newcommand\symbolsuite@error@symbol[2]{\PackageError{symbolsuite}{The symbol `#2' passed in is not a defined color of theme `#1'}{}} +%% +%% This package consists of the file palette.dtx, +%% and the generated files colorpalette.sty, +%% symbolpalette.sty, +%% palette.pdf. +%% +%% End of file `symbolpalette.sty'. -- cgit v1.2.3