Fix color transition from block title to body

I'm trying to set up a block with my own colors, but the transition from the block title to the body just looks horrible.

I already had a look at remove Beamer block transition, the code obviously works, the colors still look different even if I put my color in the code for the transition bar. This doesn't do anything if included in my code either...

Any idea how to fix the transition (favourite) or get rid of it at all?

\documentclass[11pt]{beamer}
\usetheme{Berkeley}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

%Define colors
\definecolor{color1}{cmyk}{0.75 0 0.4 0}
\definecolor{color2}{cmyk}{0.75 0 0.4 0.1}
\definecolor{color3}{cmyk}{0.75 0 0.4 0.75}

%Change block colors
\setbeamercolor{block title}{bg=color2, fg=white}
\setbeamercolor{block body}{bg=color1, fg=color3}

%Change block design

\begin{document}

\begin{frame}
\begin{block}{Some title}
$E=mc^2$
\end{block}
\end{frame}

\end{document}


I'm using the Torino theme but the outcome looks just the same.

Cheers

Markus

• Try to convert your colors in rgb model: \definecolor{color1}{rgb:cmyk}{0.75 0 0.4 0} – Paul Gaborit Mar 25 '16 at 7:41
• Thanks, now I know it's because my colors are defined in cymk. I tried your code, the transition is now smooth but the colors look absolutely different. So the transition uses rgb colors. Is there any way to make it work in cmyk, my colors are only defined in cmyk. – Markus Mar 25 '16 at 11:09
• The xcolor package and your PDF viewer convert cmyk colors to rgb colors via different methods... – Paul Gaborit Mar 25 '16 at 12:43
• So how do I get the transition to use cmyk or make the transition disappear at all in the rounded style? – Markus Mar 25 '16 at 14:09
• beamer uses rgb colors. Conversion between cmyk and rgb is device dependent and beamer uses perfect devices. You can pick the rgb color displays by your PDF viewer for each of your cmyk colors to get the same conversion as your PDF viewer. – Paul Gaborit Mar 25 '16 at 15:20

You provide colors in cmyk model. To make shadings, beamer uses colors in rgb model.

1st solution

Convert your color in rgb model:

\definecolor{color1}{rgb:cmyk}{0.75 0 0.5 0}
\definecolor{color2}{rgb:cmyk}{0.75 0 0.4 0.3}
\definecolor{color3}{rgb:cmyk}{0.75 0 0.4 0.6}


You get:

2nd solution

The xcolor package converts color from cmyk model to rgb model for perfect hypothetic devices. PDF viewers uses devices dependent conversion with default sRGB profile. So, converted colors are not the same.

You may pick the color from a screen snapshot of your PDF viewer via a graphic editor (like gimp) and its color picker tool.

Here, I get:

\definecolor{color1}{RGB}{64,190,170}
\definecolor{color2}{RGB}{58,173,155}
\definecolor{color3}{RGB}{22,62,58}


Result: