This question is related to remove Beamer block transition between title and body and How to disable color gradient between block title and block body in Beamer? but is not a duplicate of these particular two questions.
EDIT after the question was closed on 25.10.22: This question is not a duplicate of Custom color between frametitle and top ribbon because I ask here in the direction of reasons on why it happens only for the CMYK colour model; the question at the link just wants to solve the problem and is not interested in the reasons. The answer below provided by David Purton is perfectly fine for me; as a note, David Purton posted a similar reply after he replied here at the other question. END EDIT
Let us consider the following minimal example:
\documentclass{beamer}
\usepackage{etoolbox}
\setbeamertemplate{blocks}[rounded][shadow=false]
\definecolor{top}{cmyk}{1,0,0,0}
\colorlet{bottom}{top!10!white}
\BeforeBeginEnvironment{block}{
\setbeamercolor{block title}{fg=white,bg=top}
\setbeamercolor{block body}{fg=black, bg=bottom}
}
\AfterEndEnvironment{block}{
\setbeamercolor{block title}{use=structure,fg=structure.fg,bg=structure.fg!20!bg}
\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!50!bg, fg=black}
}
\makeatletter
\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
color(0pt)=(lower.bg); color(4pt)=(lower.bg); color(4pt)=(upper.bg)}
\makeatother
\begin{document}
\begin{frame}
\begin{block}{Block}
Block stuff.
\end{block}
\end{frame}
\end{document}
So, there you might notice that the transition line between the title and body part of the block (where usually the gradient is shown) is neither of the top nor of the bottom colour, but somewhere in between.
If we modify the defintion of the color top to an rgb-based color, e.g \definecolor{top}{rgb}{1,0,0}, then the approach works as desired (that is, there is no line in a different colour visible in between):

Why does this happen for the cmyk colour model only?


beamer. Do you really need CMYK for slides, though? – David Purton Oct 02 '18 at 05:11\documentclass[cmyk]{beamer}to passcmyktoxcolor(and so try to always output CMYK). Then define your colours like this:\definecolor{top}{cmyk}{1,0,1,0}and\definecolor{bottom}{cmyk}{1,0,0,0}. Then remove yourpgfdeclareverticalshadingline. You will see the top part of the box is CMYK green, the bottom is CMYK cyan. But the gradient is RGB, even though in theory everything should be CMYK. – David Purton Oct 02 '18 at 05:33