17

I believe I've correctly followed the manual in defining a custom background color in the example below. But as the example shows, the background color is black rather than an extremely pale beige. Could anybody advise what I'm doing wrong please?

\documentclass{beamer}
\definecolor{MyBackground}{RGB}{1.0000    0.9451    0.6549}
\setbeamercolor{background canvas}{bg=MyBackground}
\begin{document}
\begin{frame}
Hullo world
\end{frame}
\end{document}
4
  • 6
    \definecolor{MyBackground}{rgb}{1.0000,0.9451,0.6549}. RGB model values are integers between 0 and 255, while rgb use reals between 0 and 1.
    – Ignasi
    Apr 13, 2016 at 7:29
  • @LeoSimon and pay attention, that there should be , between the numbers. Apr 13, 2016 at 11:26
  • @Ignasi Do you want to answer? May 29, 2016 at 8:37
  • Don't think there's anything to answer, is there? I switched from RGB to rgb and added commas and everything worked as I wanted! I don't know how to accept a commment as an answer.
    – Leo Simon
    May 29, 2016 at 20:19

1 Answer 1

17

The code contains two little mistakes. First of all, commas are missing between values. And second, RGB model is defined with values between 0 and 255, while rgb model uses values between 0 and 1. Therefore, if

\definecolor{MyBackground}{RGB}{1.0000    0.9451    0.6549}

is replaced with

\definecolor{MyBackground}{rgb}{1.0000,0.9451,0.6549}

or

\definecolor{MyBackground}{RGB}{255,241,167}

everything will work.

enter image description here

\documentclass{beamer}
\definecolor{MyBackground}{rgb}{1.0000,0.9451,0.6549}
 %\definecolor{MyBackground}{RGB}{255,241,167}
\setbeamercolor{background canvas}{bg=MyBackground}
\begin{document}
\begin{frame}
Hullo world
\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .