summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/coloring/coloring-doc.tex
blob: 35672abc19f29eb6d7abfe0f2267151ea6573130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
% -*- coding: utf-8 -*-
% !TEX program = xelatex

\documentclass[14pt]{beamer}

\usepackage{coloring}
\usetheme[color=green]{epyt} % https://www.ctan.org/pkg/epyt

\usepackage{arev} % use arev sans font

\hypersetup{
  pdfpagemode={FullScreen},
}

\usepackage{listings}
\lstset{basicstyle=\ttfamily\color{rgbx55}}

\usepackage{tabu}

\AtBeginDocument{
  \setlength{\parskip}{5pt plus 1pt minus 1pt}
  \setlength{\baselineskip}{19pt plus 1pt minus 1pt}
  \setlength{\lineskiplimit}{4pt}
  \setlength{\lineskip}{4pt}
}

\begin{document}

\title{LaTeX Package Coloring}
\author{zohooo@yeah.net}
%\institute{https://github.com/zohooo/coloring}

\begin{frame}%[plain]
\transboxout
\titlepage
\end{frame}

\begin{frame}[fragile]{Introduction}
The \verb|coloring| package makes it possible to define colors automatically by their names.
\begin{itemize}
  \item It's useful in drawing a \verb|tikz| picture.
  \item It's useful in designing a \verb|beamer| theme.
\end{itemize}
Using the package, you \alert{don't} need to write \verb|\definecolor| before using a color.
\end{frame}

\begin{frame}[fragile]{Example One: Gray Colors}
When you write
\begin{lstlisting}
\textcolor{gray2}{Text}
\end{lstlisting}
The package will automatically define the following \alert{gray} color for you
\begin{lstlisting}
\definecolor{gray2}{gray}{0.2}
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]{Example Two: RGB Colors}
When you write
\begin{lstlisting}
\colorbox{rgb37x}{Text}
\end{lstlisting}
The package will automatically define the following \alert{rgb} color for you
\begin{lstlisting}
\definecolor{rgb37x}{rgb}{0.3,0.7,1.0}
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]{Example Three: HSB Colors}
When you write
\begin{lstlisting}
\colorlet{mycolor}{blue59}
\end{lstlisting}
The package will automatically define the following \alert{hsb} color for you
\begin{lstlisting}
\definecolor{blue59}{Hsb}{240,0.5,0.9}
\end{lstlisting}
You may add the following line to the preamble when using hsb colors
\begin{lstlisting}
\substitutecolormodel{hsb}{rgb}
\end{lstlisting}
\end{frame}

\def\mycolor#1{\noindent\color{black}\fcolorbox{gray}{#199}{\strut#1}}
\begin{frame}{HSB Colors}
\begin{center}
\begin{tabu}{|r|X||r|X|}\hline
  Hue & Name             & Hue & Name              \\\hline
  0   & \mycolor{red}    & 180 & \mycolor{cyan}    \\\hline
  30  & \mycolor{brown}  & 210 & \mycolor{azure}   \\\hline
  60  & \mycolor{yellow} & 240 & \mycolor{blue}    \\\hline
  90  & \mycolor{olive}  & 270 & \mycolor{violet}  \\\hline
  120 & \mycolor{green}  & 300 & \mycolor{magenta} \\\hline
  150 & \mycolor{teal}   & 330 & \mycolor{purple}  \\\hline
\end{tabu}
\end{center}
\end{frame}

\end{document}