• No results found

palette – Create palettes for colors and symbols Dennis Chen proofprogram@gmail.com v1.1.0 (2021/07/29)

N/A
N/A
Protected

Academic year: 2021

Share "palette – Create palettes for colors and symbols Dennis Chen proofprogram@gmail.com v1.1.0 (2021/07/29)"

Copied!
3
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

palette – Create palettes for colors and symbols

Dennis Chen

proofprogram@gmail.com

v1.1.0 (2021/07/29)

Abstract

The palette package provides colorpalette.sty and symbolpalette.sty, which can be used to create and manage palettes of colors and symbols, respec-tively.

1

Overview

We will go over the basic structure of the user interface in broad terms first (i.e. no macros or environments yet). We will use colorpalette as our example here, but symbolpalette behaves virtually identically.

First, the user can create palette themes, which are independent from each other. Then, you can add colors to themes. Finally, you can make a palette associated with a theme and set its colors.

2

colorpalette.sty

2.1

Usage

To create a new palette theme called theme, write \newpalettetheme{theme}.

\newpalettetheme

To add a color color to theme theme, write \addcolortotheme{theme}{color}.

\addcolortotheme

To create a new palette palette based on theme theme, write \newpalette{theme}{palette}.

\newpalette

Palette names only need to be unique across the same theme. This means that you can have two palettes with the same name if they are associated with different themes.

To set the color color (which was defined with respect to the theme of the

\setpalettecolor

palette) as the color value value in the format encoding (which by default is HTML) of palette palette in theme theme, write

\setpalettecolor{theme}{palette}{color}[encoding]{value}

This sets the active palette of a theme. (This is how palettes are “swapped

\activepalette

in” with respect to a theme.) To set the active palette of theme theme as palette, write \activepalette{theme}{palette}.

To use, write \getcolor{theme}{color}. This gets the internal color name

\getcolor

(2)

from the active palette of theme. No errors will be thrown even if you pass in an undefined theme or color (with respect to the theme). This limitation is because we must be able to parse \getcolor.

To use, write \applycolor{theme}{color}. This applies color color from the

\applycolor

active palette of theme theme. (This means that the newly defined color is passed into \color.) If theme has no active palette, an error will be thrown.

To make it clearer what \applycolor does, we will just show the macro defini-tion directly (since it is quite simple). (The macros \colorpalette@themecheck and \colorpalette@colorcheck are just for error handling.)

1⟨∗color⟩ 2\newcommand\applycolor[2]{% 3 \colorpalette@themecheck{#1}% 4 \colorpalette@colorcheck{#1}{#2}% 5 \color{\getcolor{#1}{#2}}% 6} 7⟨/color⟩

2.2

Error Messages

If a nonexistent theme is passed in, the following error will be thrown:

The palette passed in is not a defined palette of theme ‘#1’

where #1 is the name of the theme.

If a palette that does not belong to a theme is passed in, the following error will be thrown:

The palette ‘#2’ passed in is not a defined palette of theme ‘#1’

where #1 is the name of the theme and #2 is the name of the palette.

If a color that does not belong to a theme is passed in, the following error will be thrown:

The color ‘#2’ passed in is not a defined color of theme ‘#1’

where #1 is the name of the theme and #2 is the name of the color.

3

symbolpalette.sty

Despite the name symbolpalette (which is used to identify it as one of the files of the package palette), the main keyword is a suite. This is because the keyword palette is already used for colorpalette.

This package is nearly analogous to colorpalette. A suite is analogous to a palette, and a symbol is analogous to a color. Themes are used in both packages.

(3)

3.1

Usage

To create a new suite theme called theme, write \newsuitetheme{theme}.

\newsuitetheme

To add a symbol symbol to theme theme, write \addsymboltotheme{theme}{symbol}.

\addsymboltotheme

To create a new suite suite based on theme theme, write \newsuite{theme}{suite}.

\newsuite

Suite names only need to be unique across the same theme. This means that you can have two suites with the same name if they are associated with different themes.

To set the symbol symbol (which was defined with respect to the theme of the

\setsuitesymbol

suite) as the icon icon of suite suite in theme theme, write

\setsuitesymbol{theme}{suite}{symbol}{icon}

This sets the active suite of a theme. (This is how suites are “swapped in”

\activesuite

with respect to a theme.) To set the active suite of theme theme as suite, write \activesuite{theme}{suite}.

To use, write \printsymbol{theme}{symbol}. This is similar to

color-\printsymbol

palette.sty’s \applycolor.

3.2

Error Messages

If a nonexistent theme is passed in, the following error will be thrown:

The palette passed in is not a defined palette of theme ‘#1’

where #1 is the name of the theme.

If a suite that does not belong to a theme is passed in, the following error will be thrown:

The suite ‘#2’ passed in is not a defined suite of theme ‘#1’

where #1 is the name of the theme and #2 is the name of the suite.

If a symbol that does not belong to a theme is passed in, the following error will be thrown:

The symbol ‘#2’ passed in is not a defined symbol of theme ‘#1’

where #1 is the name of the theme and #2 is the name of the symbol.

Change History

v1.0.0

General: Initial version . . . 1 v1.0.1

General: Make error message refer

to symbol, not color . . . 3 v1.1.0

General: Update macrolist (to get compatibility with etoolbox) . . 1

Referenties

GERELATEERDE DOCUMENTEN

Land acquisition in order to settle the land claim depends on the availability of land on the market. South African land reform follows the market-led approach. Therefore, there

If the package option showdeletions was used (and the author was not suppressed), then \<auth>replace displays hold-text i in gray, followed by hnew-text i in the color

gray1 red1 brown1 yellow1 olive1 green1 teal1 cyan1 azure1 blue1 violet1 magenta1 purple1 gray2 red2 brown2 yellow2 olive2 green2 teal2 cyan2 azure2 blue2 violet2 magenta2 purple2

Drivers based on ‘color3’ do not support named colours at the dvi level, but to ease document portability, the named model is still defined, but the \special’s just put the

Epyt is a simple but nice theme for Beamer, with the following features:.. É simple structure: with page numbers at footer, no head bar and

Besides the effect of associations and uniqueness on color names, also the effect of the different kinds of green color names, -positively associated, negatively associated,

Binnen het thema natuur & landschap wordt aandacht besteed aan een aantrekkelijk en toegankelijk landschap en aan het versterken van een groen netwerk zowel op het bedrijf als

Het doel van het onderzoek was het inventariseren en waarderen van potentiële archeologische resten, die door de geplande werken zullen worden verstoord of verdwijnen.. Deze