存取 tikzpictures 的投影機調色板

存取 tikzpictures 的投影機調色板

我無法讓這裡提出的解決方案運作:存取由獨立 tikzpicture 的投影機顏色主題定義的顏色

\documentclass[hyperref={pdfpagelabels=false},xcolor=x11names,compress]{beamer}
\usetheme{Boadilla}
\usepackage{tikz}%Mind map
\usetikzlibrary{mindmap,trees} %Mind map
\usepackage{media9,multimedia,comment,booktabs,datetime}

\begin{document}
\begin{frame}
\frametitle{Literature Review}
%\tikzset{every node/.append style={scale=2}}
\resizebox{0.9\textwidth}{!}{
\hspace{50pt}\begin{tikzpicture}
 %\tikzstyle{every node}=[font=\Large,level distance=8cm]
    \path[mindmap,concept color=DeepSkyBlue4,text=white,font=\sf\bf,text width=5cm,
        level 1/.append style={level distance=6cm,sibling angle=60},
        level 2/.append style={level distance=4cm},]

        node[concept] {Learning}[clockwise from=0]
        child[concept color=DeepSkyBlue4] {
            node[concept] {practical}[clockwise from=90]
            child { node[concept] {algorithms} [clockwise from=40]
            child { node[concept] {databases} }
            child { node[concept] {WWW} }}
            child { node[concept] {data structures} }
        }  
        child[concept color=red,text=black] {
            node[concept] {applied}[clockwise from=360]
            child { node[concept,level distance=16cm,sibling angle=60] {databases} }
        }
        child[concept color=red,text=black] { 
            node[concept] {technical} 
        }
        child[concept color=red,text=black] { 
            node[concept,text width=2cm] {theoretical} 
        };
\end{tikzpicture}}
\end{frame}

\end{document}

我如何用red所選主題設定的內容替換上面的內容(或使用 自訂\setbeamercolor*{palette tertiary}{fg=black,bg=black!10}?我想對各種 tikzpicture、pgfplots 等執行此操作。

答案1

我不知道為什麼,但有些beamer顏色可用(例如structure.fg),而有些則不可用。但你總是可以定義基於投影機主題的您自己的顏色。這樣,當您更改投影機主題時,所有顏色都會改變。

\usebeamercolor{block title alerted}
\colorlet{color1}{bg}

color1將等於block title alerted.bg顏色。您可以重複此行定義更多顏色。下一個程式碼顯示了此解決方案的範例。

Claudio Fiandrino 提供了另一個解決方案如何在投影機中取得顏色主題顏色的實際值?其中新命令\ccft(從模板建立顏色)用於定義普通的顏色基於投影儀那些。

\documentclass[hyperref={pdfpagelabels=false},xcolor=x11names,compress]{beamer}
\usetheme{Boadilla}
\usepackage{tikz}%Mind map
\usetikzlibrary{mindmap,trees} %Mind map
\usepackage{media9,multimedia,comment,booktabs,datetime}

\usebeamercolor{block title alerted}
\colorlet{color1}{bg}
\usebeamercolor{block body}
\colorlet{color2}{bg}
\colorlet{color3}{bg!30!color1}

\setbeamercolor*{palette tertiary}{fg=red,bg=black!10}
\usebeamercolor{palette tertiary}
\colorlet{color4}{bg}

\begin{document}
\begin{frame}
\frametitle{Literature Review}
\resizebox{0.9\textwidth}{!}{
\hspace{50pt}\begin{tikzpicture}
    \path[mindmap,
        concept color=structure.fg,
        text=white,font=\sf\bf,text width=5cm,
       level 1/.append style={level distance=6cm,sibling angle=60},
       level 2/.append style={level distance=4cm},]

       node[concept] {Learning}[clockwise from=0]
       child[concept color=color1] {
            node[concept] {practical}[clockwise from=90]
            child { node[concept, concept color=color2] {algorithms} [clockwise from=40]
            child { node[concept] {databases} }
            child { node[concept] {WWW} }}
            child { node[concept] {data structures} }
        }  
        child[concept color=color3,text=black] {
            node[concept] {applied}[clockwise from=360]
            child { node[concept,level distance=16cm,sibling angle=60] {databases} }
        }
        child[concept color=color4,text=black] { 
            node[concept] {technical} 
        }
        child[concept color=color4!30!black, text=white] { 
            node[concept,text width=2cm] {theoretical} 
        };
\end{tikzpicture}}
\end{frame}

\end{document}

在此輸入影像描述

相關內容