Debian Codegraph @

texmf-dist/doc/latex/coloring/coloring-doc.tex

raw
1 % -*- coding: utf-8 -*-
2 % !TEX program = xelatex
3
4 \documentclass[14pt]{beamer}
5
6 \usepackage{coloring}
7 \usetheme[color=green]{epyt} % https://www.ctan.org/pkg/epyt
8
9 \usepackage{arev} % use arev sans font
10
11 \hypersetup{
12 pdfpagemode={FullScreen},
13 }
14
15 \usepackage{listings}
16 \lstset{basicstyle=\ttfamily\color{rgbx55}}
17
18 \usepackage{tabu}
19
20 \AtBeginDocument{
21 \setlength{\parskip}{5pt plus 1pt minus 1pt}
22 \setlength{\baselineskip}{19pt plus 1pt minus 1pt}
23 \setlength{\lineskiplimit}{4pt}
24 \setlength{\lineskip}{4pt}
25 }
26
27 \begin{document}
28
29 \title{LaTeX Package Coloring}
30 \author{[email protected]}
31 %\institute{https://github.com/zohooo/coloring}
32
33 \begin{frame}%[plain]
34 \transboxout
35 \titlepage
36 \end{frame}
37
38 \begin{frame}[fragile]{Introduction}
39 The \verb|coloring| package makes it possible to define colors automatically by their names.
40 \begin{itemize}
41 \item It's useful in drawing a \verb|tikz| picture.
42 \item It's useful in designing a \verb|beamer| theme.
43 \end{itemize}
44 Using the package, you \alert{don't} need to write \verb|\definecolor| before using a color.
45 \end{frame}
46
47 \begin{frame}[fragile]{Example One: Gray Colors}
48 When you write
49 \begin{lstlisting}
50 \textcolor{gray2}{Text}
51 \end{lstlisting}
52 The package will automatically define the following \alert{gray} color for you
53 \begin{lstlisting}
54 \definecolor{gray2}{gray}{0.2}
55 \end{lstlisting}
56 \end{frame}
57
58 \begin{frame}[fragile]{Example Two: RGB Colors}
59 When you write
60 \begin{lstlisting}
61 \colorbox{rgb37x}{Text}
62 \end{lstlisting}
63 The package will automatically define the following \alert{rgb} color for you
64 \begin{lstlisting}
65 \definecolor{rgb37x}{rgb}{0.3,0.7,1.0}
66 \end{lstlisting}
67 \end{frame}
68
69 \begin{frame}[fragile]{Example Three: HSB Colors}
70 When you write
71 \begin{lstlisting}
72 \colorlet{mycolor}{blue59}
73 \end{lstlisting}
74 The package will automatically define the following \alert{hsb} color for you
75 \begin{lstlisting}
76 \definecolor{blue59}{Hsb}{240,0.5,0.9}
77 \end{lstlisting}
78 You may add the following line to the preamble when using hsb colors
79 \begin{lstlisting}
80 \substitutecolormodel{hsb}{rgb}
81 \end{lstlisting}
82 \end{frame}
83
84 \def\mycolor#1{\noindent\color{black}\fcolorbox{gray}{#199}{\strut#1}}
85 \begin{frame}{HSB Colors}
86 \begin{center}
87 \begin{tabu}{|r|X||r|X|}\hline
88 Hue & Name & Hue & Name \\\hline
89 0 & \mycolor{red} & 180 & \mycolor{cyan} \\\hline
90 30 & \mycolor{brown} & 210 & \mycolor{azure} \\\hline
91 60 & \mycolor{yellow} & 240 & \mycolor{blue} \\\hline
92 90 & \mycolor{olive} & 270 & \mycolor{violet} \\\hline
93 120 & \mycolor{green} & 300 & \mycolor{magenta} \\\hline
94 150 & \mycolor{teal} & 330 & \mycolor{purple} \\\hline
95 \end{tabu}
96 \end{center}
97 \end{frame}
98
99 \end{document}