-
Notifications
You must be signed in to change notification settings - Fork 0
/
macosbox.sty
69 lines (62 loc) · 2.25 KB
/
macosbox.sty
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
\ProvidesPackage{macosbox}
\RequirePackage{xcolor}
\RequirePackage[most]{tcolorbox}
\RequirePackage{fontawesome}
\RequirePackage{ifthen}
\definecolor{macosbox@red}{RGB}{236,96,92}
\definecolor{macosbox@yellow}{RGB}{247,188,44}
\definecolor{macosbox@green}{RGB}{88,204,65}
\definecolor{macosbox@top}{RGB}{237,237,237}
\definecolor{macosbox@bot}{RGB}{189,189,189}
\definecolor{macosbox@bord}{RGB}{182,176,176}
\definecolor{macosbox@bg}{RGB}{240,240,240}
\definecolor{macosbox@textcol}{RGB}{50,50,50}
\definecolor{macosbox@topdark}{RGB}{96,96,98}
\definecolor{macosbox@botdark}{RGB}{44,45,47}
\definecolor{macosbox@borddark}{RGB}{13,13,15}
\definecolor{macosbox@bgdark}{RGB}{55,56,58}
\definecolor{macosbox@textcoldark}{RGB}{223,224,226}
\def\macosbox@mintedstyle{xcode}
\def\macosbox@darkmintedstyle{monokai}
\newcommand{\usemacosboxmintedstyle}[1]{\def\macosbox@mintedstyle{#1}}
\newcommand{\usemacosboxdarkmintedstyle}[1]{\def\macosbox@darkmintedstyle{#1}}
\newcommand{\macosbox@dot}[1]{\small\textcolor{#1}{\faCircle}}
\newenvironment{macosbox}[2][]{
\begin{tcolorbox}[enhanced,
coltitle=black,
colback=macosbox@bg,
boxrule=0mm,
frame style={draw=macosbox@bord,fill=macosbox@bord},
title style={top color=macosbox@top,bottom color=macosbox@bot},
drop fuzzy shadow=black,
#1, %hbox
title=\hspace*{-3mm}%
\macosbox@dot{macosbox@red} %
\macosbox@dot{macosbox@yellow} %
\macosbox@dot{macosbox@green}%
\hspace*{\fill}\hspace*{-10mm}#2\hspace*{\fill}]
\ifthenelse{\isundefined{\usemintedstyle}}{}{\usemintedstyle{\macosbox@mintedstyle}}
\color{macosbox@textcol}
}{
\end{tcolorbox}
}
\newenvironment{macosdarkbox}[2][]{
\begin{tcolorbox}[enhanced,
coltitle=white,
colback=macosbox@bgdark,
boxrule=0mm,
frame style={draw=macosbox@borddark,fill=macosbox@borddark},
title style={top color=macosbox@topdark,bottom color=macosbox@botdark},
drop fuzzy shadow=black,
#1, %hbox
title=\hspace*{-3mm}%
\macosbox@dot{macosbox@red} %
\macosbox@dot{macosbox@yellow} %
\macosbox@dot{macosbox@green}%
\hspace*{\fill}\hspace*{-10mm}#2\hspace*{\fill}]
\ifthenelse{\isundefined{\usemintedstyle}}{}{\usemintedstyle{\macosbox@darkmintedstyle}}
\color{macosbox@textcoldark}
}{
\end{tcolorbox}
}
\endinput