Pour les blocs normales (`block`, `alertblock`, `exampleblock`) ç'est facile, on peut faire
% block
\setbeamercolor{block title}{fg=structure.fg,bg=structure.fg!20!bg}
\setbeamercolor{block body}{bg=block title.bg!30!bg}
% alertblock
\setbeamercolor{block title alerted}{fg=white,bg=alerted text.fg!75!black}
\setbeamercolor{block body alerted}{bg=block title alerted.bg!10!bg}
% exampleblock
\setbeamercolor{block title example}{fg=white,bg=example text.fg!75!black}
\setbeamercolor{block body example}{bg=block title example.bg!10!bg}
Pour les blocs des théorèmes c'est plus difficile. Normalement, ils ont la même couleur que `block` ou `examplebloc`, avec un peu de travail :
\documentclass{beamer}
% block
\setbeamercolor{block title}{fg=structure.fg,bg=structure.fg!20!bg}
\setbeamercolor{block body}{bg=block title.bg!30!bg}
% alertblock
\setbeamercolor{block title alerted}{use=alerted text,fg=white,bg=alerted alerted}{fg=white,bg=alerted text.fg!75!black}
\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block alerted}{bg=block title alerted.bg!10!bg}
% exampleblock
\setbeamercolor{block title example}{use=example text,fg=white,bg=example example}{fg=white,bg=example text.fg!75!black}
\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block example}{bg=block title example.bg!10!bg}
% theorem
\BeforeBeginEnvironment{theorem}{
\setbeamercolor{block title}{fg=black,bg=orange!50!white}
\setbeamercolor{block body}{fg=orange,bg=orange!30!white}
title}{fg=black,bg=yellow!50!white}
\setbeamercolor{block body}{fg=yellow,bg=yellow!30!white}
}
\AfterEndEnvironment{theorem}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% corollary
\BeforeBeginEnvironment{corollary}{
\setbeamercolor{block title}{fg=black,bg=yellow!50!white}
\setbeamercolor{block body}{fg=yellow, bg=yellow!30!white}
title}{fg=black,bg=orange!50!white}
\setbeamercolor{block body}{fg=orange, bg=orange!30!white}
}
\AfterEndEnvironment{corollary}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% definition
\BeforeBeginEnvironment{definition}{
\setbeamercolor{block title}{fg=black,bg=red!50!white}
\setbeamercolor{block body}{fg=red, bg=red!30!white}
}
\AfterEndEnvironment{definition}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% definitions
\BeforeBeginEnvironment{definitions}{
\setbeamercolor{block title}{fg=black,bg=violet!50!white}
\setbeamercolor{block body}{fg=violet, bg=violet!30!white}
}
\AfterEndEnvironment{definitions}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% fact
\BeforeBeginEnvironment{fact}{
\setbeamercolor{block title}{fg=black,bg=blue!50!white}
\setbeamercolor{block body}{fg=blue, bg=blue!30!white}
}
\AfterEndEnvironment{fact}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% example
\BeforeBeginEnvironment{example}{
\setbeamercolor{block title example}{fg=black,bg=cyan!50!white}
\setbeamercolor{block body example}{fg=cyan, bg=cyan!30!white}
}
\AfterEndEnvironment{example}{
\setbeamercolor{block title example}{fg=exblocktitlefgsave,bg=exblocktitlebgsave}
\setbeamercolor{block body example}{fg=exblockbodyfgsave,bg=exblockbodybgsave}
}
% examples
\BeforeBeginEnvironment{examples}{
\setbeamercolor{block title example}{fg=black,bg=teal!50!white}
\setbeamercolor{block body example}{fg=teal, bg=teal!30!white}
}
\AfterEndEnvironment{examples}{
\setbeamercolor{block title example}{fg=exblocktitlefgsave,bg=exblocktitlebgsave}
\setbeamercolor{block body example}{fg=exblockbodyfgsave,bg=exblockbodybgsave}
}
% proof
\addtobeamertemplate{proof begin}{%
\setbeamercolor{block title}{fg=black,bg=green!50!white}
\setbeamercolor{block body}{fg=green, bg=green!30!white}
}
\AfterEndEnvironment{definition}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% definitions
\BeforeBeginEnvironment{definitions}{
\setbeamercolor{block title}{fg=black,bg=green!50!white}
\setbeamercolor{block body}{fg=green, bg=green!30!white}
}
\AfterEndEnvironment{definitions}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% fact
\BeforeBeginEnvironment{fact}{
\setbeamercolor{block title}{fg=black,bg=gray!50!white}
\setbeamercolor{block body}{fg=gray, bg=gray!30!white}
}
\AfterEndEnvironment{fact}{
\setbeamercolor{block title}{fg=blocktitlefgsave,bg=blocktitlebgsave}
\setbeamercolor{block body}{fg=blockbodyfgsave,bg=blockbodybgsave}
}
% example
\BeforeBeginEnvironment{example}{
\setbeamercolor{block title example}{fg=black,bg=red!50!white}
\setbeamercolor{block body example}{fg=red, bg=red!30!white}
}
\AfterEndEnvironment{example}{
\setbeamercolor{block title example}{fg=exblocktitlefgsave,bg=exblocktitlebgsave}
\setbeamercolor{block body example}{fg=exblockbodyfgsave,bg=exblockbodybgsave}
}
% examples
\BeforeBeginEnvironment{examples}{
\setbeamercolor{block title example}{fg=black,bg=green!50!white}
\setbeamercolor{block body example}{fg=green, bg=green!30!white}
}
\AfterEndEnvironment{examples}{
\setbeamercolor{block title example}{fg=exblocktitlefgsave,bg=exblocktitlebgsave}
\setbeamercolor{block body example}{fg=exblockbodyfgsave,bg=exblockbodybgsave}
}
% proof
\addtobeamertemplate{proof begin}{%
\setbeamercolor{block title}{fg=black,bg=orange!50!white}
\setbeamercolor{block body}{fg=orange, bg=orange!30!white}
}{}
\begin{document}
\usebeamercolor{block title}
\colorlet{blocktitlefgsave}{block title.fg}
\colorlet{blocktitlebgsave}{block title.bg}
\usebeamercolor{normal text}
\usebeamercolor{block body}
\colorlet{blockbodyfgsave}{block body.fg}
\colorlet{blockbodybgsave}{block body.bg}
\usebeamercolor{normal text}
\usebeamercolor{block title example}
\colorlet{exblocktitlefgsave}{block title example.fg}
\colorlet{exblocktitlebgsave}{block title example.bg}
\usebeamercolor{normal text}
\usebeamercolor{block body example}
\colorlet{exblockbodyfgsave}{block body example.fg}
\colorlet{exblockbodybgsave}{block body example.bg}
\usebeamercolor{normal text}
\begin{frame}[allowframebreaks]
% normal blocks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{block}{My block}
A block.
\end{block}
\begin{alertblock}{my alertblock}
An alertblock
\end{alertblock}
\begin{exampleblock}{my exampleblock}
An exampleblock
\end{exampleblock}
% theorem blocks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{theorem}[My theorem]
A theorem.
\end{theorem}
\begin{corollary}[My corollary]
A corollary.
\end{corollary}
\begin{definition}[My definition]
A definition.
\end{definition}
\begin{definitions}[My definitions]
A definitions.
\end{definitions}
\begin{fact}[My fact]
A fact.
\end{fact}
\begin{example}[My example]
An example.
\end{example}
\begin{examples}[My examples]
An examples.
\end{examples}
\begin{proof}[My proof]
A proof.
\end{proof}
% testing normal blocks again
\begin{block}{My block}
A block.
\end{block}
\begin{exampleblock}{my exampleblock}
An exampleblock
\end{exampleblock}
\end{frame}
\end{document}
![alt text][1]
[1]: https://texnique.fr/osqa/upfiles/Screen_Shot_2019-04-18_at_13.53.02.png
https://texnique.fr/osqa/upfiles/Screen_Shot_2019-04-18_at_14.09.56.png