43

How do I find out what color a beamer theme uses? In particular, what is the color that the Singapore theme uses? I'd like to grab this color so that I can color my tables with it and remain consistent with the general theme. I've copied and pasted the .sty file for Singapore below. I really wasn't able to glean much from looking at it.

% Copyright 2007 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/licenses/LICENSE for more details.

\ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/theme/beamerthemeSingapore.sty,v 1.10 2007/01/28 20:48:30 tantau Exp $


\DeclareOptionBeamer{compress}{\beamer@compresstrue}
\ProcessOptionsBeamer


\mode<presentation>

\setbeamercolor{section in head/foot}{use=structure,bg=structure.fg!25!bg}

\useoutertheme[subsection=false]{miniframes}


\setbeamertemplate{frametitle}[default][center]

\AtBeginDocument{%
  {
    \usebeamercolor{section in head/foot}
  }

  \pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
  {%
    color(0cm)=(bg);
    color(1.25cm)=(section in head/foot.bg)%
  }

  \setbeamercolor{section in head/foot}{bg=}
}

\addtoheadtemplate{\pgfuseshading{beamer@headfade}\vskip-1.25cm}{}

\beamertemplatedotitem

\mode
<all>
2
  • 4
    Just to be absolutely clear: are you using this theme in your presentation? Thus if you had a method whereby TeX could figure out the colour within the document, but you never knew the exact RGB values, would that suffice for your purposes? Nov 5, 2011 at 20:08
  • 1
    Yes, that would suffice. Probably be ideal actually.
    – lowndrul
    Nov 5, 2011 at 22:02

2 Answers 2

47

A beamer presentation uses several colors. beamer provides commands for using colors of the presentation elements. Choose the element of which you would like to use the color and apply it, for example:

{\usebeamercolor[fg]{structure} text}

prints text in a blue color, with Singapore theme.

Here fg means foreground, bg means background, instead of structure you may use title in head, section in head, normal text and many more. Have a look into the beamer manual for learning more about using colors.

6
  • 4
    Specifically, Section 17.2 "Changing the Colors ...". The \usebeamercolor command, and all its variants, are explained in Section 17.2.2. Nov 5, 2011 at 22:30
  • 1
    Thank you for the help. I checked out the manual and should mention that structure.fg was particularly useful to me. Because I'm coloring rows I need to do something like \rowcolor{<my color>}. structure.fg worked for <my color> whereas \usebeamercolor[fg]{structure} did not. Is this regular practice?
    – lowndrul
    Nov 6, 2011 at 0:15
  • 1
    Thanks @AndrewStacey, that manual is ridiculously difficult to find things in.
    – naught101
    Apr 29, 2012 at 14:15
  • Where can I find the information related to the use of title in head?
    – Karlo
    Apr 19, 2018 at 10:08
  • 1
    @Marijn, maybe related to my comment tex.stackexchange.com/questions/33764/… ?
    – Rmano
    Sep 11, 2020 at 15:02
6

All the informations on color themes are in the directory Beamer\Base\Themes. But it's easier to write color=block body.bg to use the background color of the body of block, independently of the theme chosen.

1
  • 1
    Notice that you need to have used the color before to be able to use, for example, \rowcolor{block body.bg}. I suggest sticking a (null) {\usebeamercolor[bg]{block body}}% at the start of the frame to stay on the safe side.
    – Rmano
    Sep 11, 2020 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.