如何绘制如下图所示的渐变颜色形状?

如何绘制如下图所示的渐变颜色形状?
\documentclass[11pt, oneside, a4paper, titlepage]{article}
\usepackage[dvipsnames, svgnames, xllsnames]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage[left=0.1cm, right=0.1cm, top=0.1cm, bottom=0.1cm]{geometry}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{arrows, shapes, positioning, shadows}

\definecolor{RollBack}{RGB}{224, 207, 196}
\title{sdfld}
\date{}

\begin{document}
\tcbset{colframe=gray!0, colback=RollBack, arc=0mm}

\begin{tcolorbox}
\begin{minipage}{4.5cm}
\hspace*{0.4cm}
\begin{tikzpicture}[remember picture, overlay]
\fill[fill=Brown!20]([xshift=1.48mm, yshift=-1.5mm]current page.north west) --++(0.05\paperwidth, 0) --++(0.12\paperwidth, -2.3) --++(-0.12\paperwidth, -2.3) --++(-0.05\paperwidth, -0) --cycle;
\end{tikzpicture}
\vspace*{4cm}
\end{minipage}
\begin{minipage}{18cm}
\begin{center}
\Huge{\textcolor{white}{ABC}}\\
\vspace*{0.5cm}
\Large{\textcolor{white}{\emph{Designer | Graphics}}}
\end{center}
\end{minipage}
\end{tcolorbox}
\end{document}

在此处输入图片描述

答案1

您可以使用\shade来获得基本效果。

在此处输入图片描述

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\fill[blue!10] (0,0) rectangle (12,4);
\shade[left color=blue!30, right color=blue!50] (0,0)--(1,0)--(3,2)--(1,4)--(0,4)--cycle;
\shade[left color=blue!10, right color=blue!20] (1,0)--(4,3)--(5,2)--(3,0)--cycle;
\shade[left color=blue!10, right color=blue!30] (1,4)--(3,2)--(4,3)--(3,4)--cycle;
\end{tikzpicture}

\end{document}

答案2

效率不高,但像这样?我实际上没有给它们加阴影,但你有Sandy G 的代码为了那个原因。

分层阴影

minipage基本思路是将部分透明的形状分层,这样颜色就会从浅到深逐渐增加。我还通过删除s 并将文本添加到图片中,稍微简化了代码。

\documentclass[11pt, oneside, a4paper, titlepage]{article}
% ateb: https://tex.stackexchange.com/a/712617/ addaswyd o gwestiwn Vishakha: https://tex.stackexchange.com/q/712585/
\usepackage[dvipsnames, svgnames, x11names]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage[left=0.1cm, right=0.1cm, top=0.1cm, bottom=0.1cm]{geometry}
\usetikzlibrary{backgrounds,positioning}

\definecolor{RollBack}{RGB}{224, 207, 196}
\title{sdfld}
\date{}

\newlength\lengtha
\newlength\lengthb
\newlength\lengthc
\begin{document}
\tcbset{colframe=gray!0, colback=RollBack, arc=0mm}

\begin{tcolorbox}
  \begin{tikzpicture}[remember picture, overlay]
    \setlength \lengtha{0.12\paperwidth}
    \setlength \lengthb{23mm}
    \begin{scope}[on background layer]
      \fill[fill=Brown,opacity=.1]([xshift=1.48mm, yshift=-1.5mm]current page.north west) coordinate (a1) --++(0.22\paperwidth,0) coordinate (b1) --++(\lengtha,-\lengthb) coordinate (c1) -- ([yshift=-\lengthb]c1-|b1) coordinate (d1) -- (a1|-d1) coordinate (e1) --cycle;
    \end{scope}
    \fill[fill=Brown,opacity=.1](a1) coordinate (a2) --++(0.05\paperwidth, 0) coordinate (b2) --++(\lengtha, -2.3) coordinate (c2) -- (b2|-d1) coordinate (d2) -- (d2-|a2) coordinate (e2) --cycle;
    \pgfmathsetmacro \tempres {atan(\lengthb/\lengtha)}
    \pgfmathsetlength \lengthc {2\lengthb/sin(\tempres)}
    \begin{scope}[on background layer]
      \clip (a1) -- (b1) -- (c1) -- (d1) -- (e1) -- cycle;
      \fill[fill=Brown,opacity=.1](a1)   -- (e2)  -- (d2) -- ++(\tempres:\lengthc) coordinate (f) --  (a2) -- cycle;
    \end{scope}
    \node (abc) [text=white,font=\Huge,anchor=south]at ([xshift=37.5mm,yshift=2mm]current page.center |- c1) {ABC};
    \node [below=2mm of abc |- c1,anchor=north,font=\Large\itshape,text=white] {Designer \textbar{} Graphics};
  \end{tikzpicture}
  \vspace*{4cm}
\end{tcolorbox}

\end{document}

编辑

此版本对形状进行了阴影处理,但与 Sandy G 的答案不同,它radial使用阴影并进行了裁剪。这比我原来的结果产生了更微妙的效果。

带有阴影的层次

\documentclass[11pt, oneside, a4paper, titlepage]{article}
% ateb: https://tex.stackexchange.com/a/712617/ addaswyd o gwestiwn Vishakha: https://tex.stackexchange.com/q/712585/
\usepackage[dvipsnames, svgnames, x11names]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage[left=0.1cm, right=0.1cm, top=0.1cm, bottom=0.1cm]{geometry}
\usetikzlibrary{backgrounds,positioning,shadings}

\definecolor{RollBack}{RGB}{224, 207, 196}
\title{sdfld}
\date{}

\newlength\lengtha
\newlength\lengthb
\newlength\lengthc
\begin{document}
\tcbset{colframe=gray!0, colback=RollBack, arc=0mm}

\begin{tcolorbox}
  \begin{tikzpicture}[remember picture, overlay]
    \setlength \lengtha{0.12\paperwidth}
    \setlength \lengthb{23mm}
    \begin{scope}[on background layer]
      \clip ([xshift=1.48mm, yshift=-1.5mm]current page.north west) coordinate (a1) --++(0.22\paperwidth,0) coordinate (b1) --++(\lengtha,-\lengthb) coordinate (c1) -- ([yshift=-\lengthb]c1-|b1) coordinate (d1) -- (a1|-d1) coordinate (e1) --cycle;
      \path [inner color=white,outer color=Brown,opacity=.1] (a1 |- c1) circle (.22\paperwidth+\lengtha);
    \end{scope}
    \begin{scope}
      \clip(a1) coordinate (a2) --++(0.05\paperwidth, 0) coordinate (b2) --++(\lengtha, -2.3) coordinate (c2) -- (b2|-d1) coordinate (d2) -- (d2-|a2) coordinate (e2) --cycle;
      \path [inner color=white,outer color=Brown,opacity=.1](a1 |- c1) circle (.05\paperwidth+\lengtha);
    \end{scope}
    \pgfmathsetmacro \tempres {atan(\lengthb/\lengtha)}
    \pgfmathsetlength \lengthc {2\lengthb/sin(\tempres)}
    \begin{scope}[on background layer]
      \clip(a1)   -- (e2)  -- (d2) -- ++(\tempres:\lengthc) coordinate (f) --  (a2) -- cycle;
      \path [inner color=white,outer color=Brown,opacity=.1] (a1 |- c1) circle (.22\paperwidth+\lengtha);
    \end{scope}
    \node (abc) [text=white,font=\Huge,anchor=south]at ([xshift=37.5mm,yshift=2mm]current page.center |- c1) {ABC};
    \node [below=2mm of abc |- c1,anchor=north,font=\Large\itshape,text=white] {Designer \textbar{} Graphics};
  \end{tikzpicture}
  \vspace*{4cm}
\end{tcolorbox}

\end{document}

我想将它集成到中tcolorbox,但我现在无法让它工作。

相关内容