How to fill a split node with two different colors?












9














I have that issue when try to fill a split node with two different colors. After using rectangle split part fill={red,blue} as an node argument the drop shadow overlap the node because I don't use the fill=color argument.



How can I avoid this issue?enter image description here



Full code:



%USER INTERFACE CLASS DIAGRAMM
documentclass{minimal}
usepackage[a4paper,margin=1cm,landscape]{geometry}
usepackage{tikz}
usepackage{xcolor}

%%%<
usepackage{verbatim}
usepackage[active,tightpage]{preview}
PreviewEnvironment{tikzpicture}
setlengthPreviewBorder{5pt}%
%%%>

begin{comment}
:Title: User Interface Class diagram
end{comment}

%COLORS
definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

%WRITE CODE
deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
defcode#1{texttt{#1}newline}
defcodeEnd#1{texttt{#1}}

usetikzlibrary{positioning,shapes,shadows,arrows}

begin{document}
tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
text centered, anchor=north, text=white, text width=3cm]
tikzstyle{comment}=[rectangle, draw=black, rounded corners,
text centered, anchor=north, text=white, text width=3cm]
tikzstyle{myarrow}=[->, >=open triangle 90, thick]
tikzstyle{line}=[-, thick]

begin{center}
begin{tikzpicture}[node distance=3.8cm]
node [text width=4cm] at (-7,0) {title{Interface}};

node (Client) [abstract, rectangle split, rectangle split parts=2]
{
textbf{Client}
nodepart{second}Schnittstellen
};

%NODE LEVEL 01
node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

%CONSOLE
node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
{
textbf{Console}
nodepart{second}Benutzereingaben
};
node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, drop shadow, below=0.2cm of Console, text justified]
{
textbf{Funktionen}
nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
};
end{tikzpicture}
end{center}
end{document}









share|improve this question









New contributor




Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    9














    I have that issue when try to fill a split node with two different colors. After using rectangle split part fill={red,blue} as an node argument the drop shadow overlap the node because I don't use the fill=color argument.



    How can I avoid this issue?enter image description here



    Full code:



    %USER INTERFACE CLASS DIAGRAMM
    documentclass{minimal}
    usepackage[a4paper,margin=1cm,landscape]{geometry}
    usepackage{tikz}
    usepackage{xcolor}

    %%%<
    usepackage{verbatim}
    usepackage[active,tightpage]{preview}
    PreviewEnvironment{tikzpicture}
    setlengthPreviewBorder{5pt}%
    %%%>

    begin{comment}
    :Title: User Interface Class diagram
    end{comment}

    %COLORS
    definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
    definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

    %WRITE CODE
    deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
    defcode#1{texttt{#1}newline}
    defcodeEnd#1{texttt{#1}}

    usetikzlibrary{positioning,shapes,shadows,arrows}

    begin{document}
    tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
    text centered, anchor=north, text=white, text width=3cm]
    tikzstyle{comment}=[rectangle, draw=black, rounded corners,
    text centered, anchor=north, text=white, text width=3cm]
    tikzstyle{myarrow}=[->, >=open triangle 90, thick]
    tikzstyle{line}=[-, thick]

    begin{center}
    begin{tikzpicture}[node distance=3.8cm]
    node [text width=4cm] at (-7,0) {title{Interface}};

    node (Client) [abstract, rectangle split, rectangle split parts=2]
    {
    textbf{Client}
    nodepart{second}Schnittstellen
    };

    %NODE LEVEL 01
    node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

    %CONSOLE
    node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
    {
    textbf{Console}
    nodepart{second}Benutzereingaben
    };
    node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, drop shadow, below=0.2cm of Console, text justified]
    {
    textbf{Funktionen}
    nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
    };
    end{tikzpicture}
    end{center}
    end{document}









    share|improve this question









    New contributor




    Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      9












      9








      9


      1





      I have that issue when try to fill a split node with two different colors. After using rectangle split part fill={red,blue} as an node argument the drop shadow overlap the node because I don't use the fill=color argument.



      How can I avoid this issue?enter image description here



      Full code:



      %USER INTERFACE CLASS DIAGRAMM
      documentclass{minimal}
      usepackage[a4paper,margin=1cm,landscape]{geometry}
      usepackage{tikz}
      usepackage{xcolor}

      %%%<
      usepackage{verbatim}
      usepackage[active,tightpage]{preview}
      PreviewEnvironment{tikzpicture}
      setlengthPreviewBorder{5pt}%
      %%%>

      begin{comment}
      :Title: User Interface Class diagram
      end{comment}

      %COLORS
      definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
      definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

      %WRITE CODE
      deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
      defcode#1{texttt{#1}newline}
      defcodeEnd#1{texttt{#1}}

      usetikzlibrary{positioning,shapes,shadows,arrows}

      begin{document}
      tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
      text centered, anchor=north, text=white, text width=3cm]
      tikzstyle{comment}=[rectangle, draw=black, rounded corners,
      text centered, anchor=north, text=white, text width=3cm]
      tikzstyle{myarrow}=[->, >=open triangle 90, thick]
      tikzstyle{line}=[-, thick]

      begin{center}
      begin{tikzpicture}[node distance=3.8cm]
      node [text width=4cm] at (-7,0) {title{Interface}};

      node (Client) [abstract, rectangle split, rectangle split parts=2]
      {
      textbf{Client}
      nodepart{second}Schnittstellen
      };

      %NODE LEVEL 01
      node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

      %CONSOLE
      node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
      {
      textbf{Console}
      nodepart{second}Benutzereingaben
      };
      node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, drop shadow, below=0.2cm of Console, text justified]
      {
      textbf{Funktionen}
      nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
      };
      end{tikzpicture}
      end{center}
      end{document}









      share|improve this question









      New contributor




      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have that issue when try to fill a split node with two different colors. After using rectangle split part fill={red,blue} as an node argument the drop shadow overlap the node because I don't use the fill=color argument.



      How can I avoid this issue?enter image description here



      Full code:



      %USER INTERFACE CLASS DIAGRAMM
      documentclass{minimal}
      usepackage[a4paper,margin=1cm,landscape]{geometry}
      usepackage{tikz}
      usepackage{xcolor}

      %%%<
      usepackage{verbatim}
      usepackage[active,tightpage]{preview}
      PreviewEnvironment{tikzpicture}
      setlengthPreviewBorder{5pt}%
      %%%>

      begin{comment}
      :Title: User Interface Class diagram
      end{comment}

      %COLORS
      definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
      definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

      %WRITE CODE
      deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
      defcode#1{texttt{#1}newline}
      defcodeEnd#1{texttt{#1}}

      usetikzlibrary{positioning,shapes,shadows,arrows}

      begin{document}
      tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
      text centered, anchor=north, text=white, text width=3cm]
      tikzstyle{comment}=[rectangle, draw=black, rounded corners,
      text centered, anchor=north, text=white, text width=3cm]
      tikzstyle{myarrow}=[->, >=open triangle 90, thick]
      tikzstyle{line}=[-, thick]

      begin{center}
      begin{tikzpicture}[node distance=3.8cm]
      node [text width=4cm] at (-7,0) {title{Interface}};

      node (Client) [abstract, rectangle split, rectangle split parts=2]
      {
      textbf{Client}
      nodepart{second}Schnittstellen
      };

      %NODE LEVEL 01
      node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

      %CONSOLE
      node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
      {
      textbf{Console}
      nodepart{second}Benutzereingaben
      };
      node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, drop shadow, below=0.2cm of Console, text justified]
      {
      textbf{Funktionen}
      nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
      };
      end{tikzpicture}
      end{center}
      end{document}






      tikz-pgf tikz-node tikz-pic






      share|improve this question









      New contributor




      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 20 hours ago









      God Must Be Crazy

      5,40511039




      5,40511039






      New contributor




      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      Nusserdt

      461




      461




      New contributor




      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Nusserdt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          3 Answers
          3






          active

          oldest

          votes


















          7














          There must certainly be a better solution, but here's a quick hack:
          Draw the node twice, the first time with the shadow and the second time without.



          capture



          %USER INTERFACE CLASS DIAGRAMM
          documentclass{minimal}
          usepackage[a4paper,margin=1cm,landscape]{geometry}
          usepackage{tikz}
          usepackage{xcolor}

          %%%<
          usepackage{verbatim}
          usepackage[active,tightpage]{preview}
          PreviewEnvironment{tikzpicture}
          setlengthPreviewBorder{5pt}%
          %%%>

          begin{comment}
          :Title: User Interface Class diagram
          end{comment}

          %COLORS
          definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
          definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

          %WRITE CODE
          deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
          defcode#1{texttt{#1}newline}
          defcodeEnd#1{texttt{#1}}

          usetikzlibrary{positioning,shapes,shadows,arrows}

          begin{document}
          tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,text centered, anchor=north, text=white, text width=3cm]
          tikzstyle{comment}=[rectangle, draw=black, rounded corners, text centered, anchor=north, text=white, text width=3cm]
          tikzstyle{myarrow}=[->, >=open triangle 90, thick]
          tikzstyle{line}=[-, thick]

          begin{center}
          begin{tikzpicture}[node distance=3.8cm]
          node [text width=4cm] at (-7,0) {title{Interface}};

          node (Client) [abstract, rectangle split, rectangle split parts=2]
          {
          textbf{Client}
          nodepart{second}Schnittstellen
          };

          %NODE LEVEL 01
          node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

          %CONSOLE
          node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
          {
          textbf{Console}
          nodepart{second}Benutzereingaben
          };
          begin{scope}

          end{scope}
          node (Console_Comment) [comment, rectangle split, rectangle split parts=2, drop shadow, below=0.2cm of Console, text justified]
          {
          textbf{Funktionen}
          nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
          };
          node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, below=0.2cm of Console, text justified]
          {
          textbf{Funktionen}
          nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
          };
          end{tikzpicture}
          end{center}
          end{document}





          share|improve this answer





























            7














            in year 2010 Mark Wibrow suggested me (for the similar problem) the hack which enable correct dropping show at custom fill of multi part node shape. using it in your (now really) mwe is:



            documentclass[tikz, margin=3mm]{standalone}
            usetikzlibrary{positioning,
            shadows,
            shapes.multipart}
            pgfdeclarelayer{foreground}
            pgfdeclarelayer{background}
            pgfsetlayers{background,main,foreground}
            makeatletter
            deftikz@extra@preaction#1{% suggested Mark Wibrow on c.t.t. (2010)
            {%
            pgfsys@beginscope%
            setboxtikz@figbox=boxvoidb@x%
            begingrouptikzset{#1}expandafterendgroup%
            expandafterdefexpandaftertikz@preaction@layer
            expandafter{tikz@preaction@layer}%
            ifxtikz@preaction@layerpgfutil@empty%
            path[#1];% do extra path
            else%
            begin{pgfonlayer}{tikz@preaction@layer}%
            path[#1];%
            end{pgfonlayer}
            fi%
            pgfsyssoftpath@setcurrentpathtikz@actions@path% restore
            tikz@restorepathsize%
            pgfsys@endscope%
            }%
            }
            lettikz@preaction@layer=pgfutil@empty
            tikzset{preaction layer/.store in=tikz@preaction@layer}
            makeatother

            tikzset{
            mpv/.style = {% multi part vertical (node)
            rectangle split,
            rectangle split parts=2,
            rectangle split part fill={#1},
            draw, rounded corners, text width=3cm,
            align=center, text=white,
            dsl},
            dsl/.style = {preaction layer=background, drop shadow}, % <-- this put drop shadow on background layer
            }

            begin{document}
            begin{tikzpicture}[node distance = 2mm]
            %CONSOLE
            node (n1) [mpv=black!70]
            {
            textbf{Console}
            nodepart{two} Benutzereingaben
            };
            node (n2) [mpv={red,blue}, below=of n1]
            {
            textbf{Funktionen}
            nodepart[align=left]{two} verb+Scripts+ \
            verb+Format+ \
            verb+getScripts+ \
            verb+getCode+
            };
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer























            • Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
              – Nusserdt
              21 hours ago






            • 1




              @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
              – Zarko
              18 hours ago



















            3














            How does casting shadows work? A path gets stored and reused (while shifted). You could just do the same on the background layer. My answer uses the use path trick.



            %USER INTERFACE CLASS DIAGRAMM
            documentclass{minimal}
            usepackage[a4paper,margin=1cm,landscape]{geometry}
            usepackage{tikz}
            usepackage{xcolor}

            %%%<
            usepackage{verbatim}
            usepackage[active,tightpage]{preview}
            PreviewEnvironment{tikzpicture}
            setlengthPreviewBorder{5pt}%
            %%%>

            begin{comment}
            :Title: User Interface Class diagram
            end{comment}

            %COLORS
            definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
            definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

            %WRITE CODE
            deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
            defcode#1{texttt{#1}newline}
            defcodeEnd#1{texttt{#1}}

            usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds}
            makeatletter % https://tex.stackexchange.com/a/38995/121799
            tikzset{
            use path/.code={pgfsyssoftpath@setcurrentpath{#1}}
            }
            makeatother

            begin{document}
            tikzset{abstract/.style={rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
            text centered, anchor=north, text=white, text width=3cm},
            comment/.style={rectangle, draw=black, rounded corners,
            text centered, anchor=north, text=white, text width=3cm},
            myarrow/.style={->, >=open triangle 90, thick},
            line/.style={-, thick}}

            begin{center}
            begin{tikzpicture}[node distance=3.8cm]
            node [text width=4cm] at (-7,0) {title{Interface}};

            node (Client) [abstract, rectangle split, rectangle split parts=2]
            {
            textbf{Client}
            nodepart{second}Schnittstellen
            };

            %NODE LEVEL 01
            node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

            %CONSOLE
            node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
            {
            textbf{Console}
            nodepart{second}Benutzereingaben
            };
            node (Console_Comment)
            [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue},
            save path=tmpath, below=0.2cm of Console, text justified]
            {
            textbf{Funktionen}
            nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
            };
            begin{scope}[on background layer]
            fill[black!50,opacity=0.5,
            use path=tmpath,transform canvas={xshift=0.5ex,yshift=-0.5ex}];
            end{scope}
            end{tikzpicture}
            end{center}
            end{document}


            enter image description here






            share|improve this answer





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "85"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });






              Nusserdt is a new contributor. Be nice, and check out our Code of Conduct.










              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467258%2fhow-to-fill-a-split-node-with-two-different-colors%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              7














              There must certainly be a better solution, but here's a quick hack:
              Draw the node twice, the first time with the shadow and the second time without.



              capture



              %USER INTERFACE CLASS DIAGRAMM
              documentclass{minimal}
              usepackage[a4paper,margin=1cm,landscape]{geometry}
              usepackage{tikz}
              usepackage{xcolor}

              %%%<
              usepackage{verbatim}
              usepackage[active,tightpage]{preview}
              PreviewEnvironment{tikzpicture}
              setlengthPreviewBorder{5pt}%
              %%%>

              begin{comment}
              :Title: User Interface Class diagram
              end{comment}

              %COLORS
              definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
              definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

              %WRITE CODE
              deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
              defcode#1{texttt{#1}newline}
              defcodeEnd#1{texttt{#1}}

              usetikzlibrary{positioning,shapes,shadows,arrows}

              begin{document}
              tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,text centered, anchor=north, text=white, text width=3cm]
              tikzstyle{comment}=[rectangle, draw=black, rounded corners, text centered, anchor=north, text=white, text width=3cm]
              tikzstyle{myarrow}=[->, >=open triangle 90, thick]
              tikzstyle{line}=[-, thick]

              begin{center}
              begin{tikzpicture}[node distance=3.8cm]
              node [text width=4cm] at (-7,0) {title{Interface}};

              node (Client) [abstract, rectangle split, rectangle split parts=2]
              {
              textbf{Client}
              nodepart{second}Schnittstellen
              };

              %NODE LEVEL 01
              node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

              %CONSOLE
              node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
              {
              textbf{Console}
              nodepart{second}Benutzereingaben
              };
              begin{scope}

              end{scope}
              node (Console_Comment) [comment, rectangle split, rectangle split parts=2, drop shadow, below=0.2cm of Console, text justified]
              {
              textbf{Funktionen}
              nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
              };
              node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, below=0.2cm of Console, text justified]
              {
              textbf{Funktionen}
              nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
              };
              end{tikzpicture}
              end{center}
              end{document}





              share|improve this answer


























                7














                There must certainly be a better solution, but here's a quick hack:
                Draw the node twice, the first time with the shadow and the second time without.



                capture



                %USER INTERFACE CLASS DIAGRAMM
                documentclass{minimal}
                usepackage[a4paper,margin=1cm,landscape]{geometry}
                usepackage{tikz}
                usepackage{xcolor}

                %%%<
                usepackage{verbatim}
                usepackage[active,tightpage]{preview}
                PreviewEnvironment{tikzpicture}
                setlengthPreviewBorder{5pt}%
                %%%>

                begin{comment}
                :Title: User Interface Class diagram
                end{comment}

                %COLORS
                definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                %WRITE CODE
                deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                defcode#1{texttt{#1}newline}
                defcodeEnd#1{texttt{#1}}

                usetikzlibrary{positioning,shapes,shadows,arrows}

                begin{document}
                tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,text centered, anchor=north, text=white, text width=3cm]
                tikzstyle{comment}=[rectangle, draw=black, rounded corners, text centered, anchor=north, text=white, text width=3cm]
                tikzstyle{myarrow}=[->, >=open triangle 90, thick]
                tikzstyle{line}=[-, thick]

                begin{center}
                begin{tikzpicture}[node distance=3.8cm]
                node [text width=4cm] at (-7,0) {title{Interface}};

                node (Client) [abstract, rectangle split, rectangle split parts=2]
                {
                textbf{Client}
                nodepart{second}Schnittstellen
                };

                %NODE LEVEL 01
                node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                %CONSOLE
                node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                {
                textbf{Console}
                nodepart{second}Benutzereingaben
                };
                begin{scope}

                end{scope}
                node (Console_Comment) [comment, rectangle split, rectangle split parts=2, drop shadow, below=0.2cm of Console, text justified]
                {
                textbf{Funktionen}
                nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                };
                node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, below=0.2cm of Console, text justified]
                {
                textbf{Funktionen}
                nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                };
                end{tikzpicture}
                end{center}
                end{document}





                share|improve this answer
























                  7












                  7








                  7






                  There must certainly be a better solution, but here's a quick hack:
                  Draw the node twice, the first time with the shadow and the second time without.



                  capture



                  %USER INTERFACE CLASS DIAGRAMM
                  documentclass{minimal}
                  usepackage[a4paper,margin=1cm,landscape]{geometry}
                  usepackage{tikz}
                  usepackage{xcolor}

                  %%%<
                  usepackage{verbatim}
                  usepackage[active,tightpage]{preview}
                  PreviewEnvironment{tikzpicture}
                  setlengthPreviewBorder{5pt}%
                  %%%>

                  begin{comment}
                  :Title: User Interface Class diagram
                  end{comment}

                  %COLORS
                  definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                  definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                  %WRITE CODE
                  deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                  defcode#1{texttt{#1}newline}
                  defcodeEnd#1{texttt{#1}}

                  usetikzlibrary{positioning,shapes,shadows,arrows}

                  begin{document}
                  tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,text centered, anchor=north, text=white, text width=3cm]
                  tikzstyle{comment}=[rectangle, draw=black, rounded corners, text centered, anchor=north, text=white, text width=3cm]
                  tikzstyle{myarrow}=[->, >=open triangle 90, thick]
                  tikzstyle{line}=[-, thick]

                  begin{center}
                  begin{tikzpicture}[node distance=3.8cm]
                  node [text width=4cm] at (-7,0) {title{Interface}};

                  node (Client) [abstract, rectangle split, rectangle split parts=2]
                  {
                  textbf{Client}
                  nodepart{second}Schnittstellen
                  };

                  %NODE LEVEL 01
                  node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                  %CONSOLE
                  node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                  {
                  textbf{Console}
                  nodepart{second}Benutzereingaben
                  };
                  begin{scope}

                  end{scope}
                  node (Console_Comment) [comment, rectangle split, rectangle split parts=2, drop shadow, below=0.2cm of Console, text justified]
                  {
                  textbf{Funktionen}
                  nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                  };
                  node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, below=0.2cm of Console, text justified]
                  {
                  textbf{Funktionen}
                  nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                  };
                  end{tikzpicture}
                  end{center}
                  end{document}





                  share|improve this answer












                  There must certainly be a better solution, but here's a quick hack:
                  Draw the node twice, the first time with the shadow and the second time without.



                  capture



                  %USER INTERFACE CLASS DIAGRAMM
                  documentclass{minimal}
                  usepackage[a4paper,margin=1cm,landscape]{geometry}
                  usepackage{tikz}
                  usepackage{xcolor}

                  %%%<
                  usepackage{verbatim}
                  usepackage[active,tightpage]{preview}
                  PreviewEnvironment{tikzpicture}
                  setlengthPreviewBorder{5pt}%
                  %%%>

                  begin{comment}
                  :Title: User Interface Class diagram
                  end{comment}

                  %COLORS
                  definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                  definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                  %WRITE CODE
                  deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                  defcode#1{texttt{#1}newline}
                  defcodeEnd#1{texttt{#1}}

                  usetikzlibrary{positioning,shapes,shadows,arrows}

                  begin{document}
                  tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,text centered, anchor=north, text=white, text width=3cm]
                  tikzstyle{comment}=[rectangle, draw=black, rounded corners, text centered, anchor=north, text=white, text width=3cm]
                  tikzstyle{myarrow}=[->, >=open triangle 90, thick]
                  tikzstyle{line}=[-, thick]

                  begin{center}
                  begin{tikzpicture}[node distance=3.8cm]
                  node [text width=4cm] at (-7,0) {title{Interface}};

                  node (Client) [abstract, rectangle split, rectangle split parts=2]
                  {
                  textbf{Client}
                  nodepart{second}Schnittstellen
                  };

                  %NODE LEVEL 01
                  node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                  %CONSOLE
                  node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                  {
                  textbf{Console}
                  nodepart{second}Benutzereingaben
                  };
                  begin{scope}

                  end{scope}
                  node (Console_Comment) [comment, rectangle split, rectangle split parts=2, drop shadow, below=0.2cm of Console, text justified]
                  {
                  textbf{Funktionen}
                  nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                  };
                  node (Console_Comment) [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue}, below=0.2cm of Console, text justified]
                  {
                  textbf{Funktionen}
                  nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                  };
                  end{tikzpicture}
                  end{center}
                  end{document}






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  AndréC

                  7,46711440




                  7,46711440























                      7














                      in year 2010 Mark Wibrow suggested me (for the similar problem) the hack which enable correct dropping show at custom fill of multi part node shape. using it in your (now really) mwe is:



                      documentclass[tikz, margin=3mm]{standalone}
                      usetikzlibrary{positioning,
                      shadows,
                      shapes.multipart}
                      pgfdeclarelayer{foreground}
                      pgfdeclarelayer{background}
                      pgfsetlayers{background,main,foreground}
                      makeatletter
                      deftikz@extra@preaction#1{% suggested Mark Wibrow on c.t.t. (2010)
                      {%
                      pgfsys@beginscope%
                      setboxtikz@figbox=boxvoidb@x%
                      begingrouptikzset{#1}expandafterendgroup%
                      expandafterdefexpandaftertikz@preaction@layer
                      expandafter{tikz@preaction@layer}%
                      ifxtikz@preaction@layerpgfutil@empty%
                      path[#1];% do extra path
                      else%
                      begin{pgfonlayer}{tikz@preaction@layer}%
                      path[#1];%
                      end{pgfonlayer}
                      fi%
                      pgfsyssoftpath@setcurrentpathtikz@actions@path% restore
                      tikz@restorepathsize%
                      pgfsys@endscope%
                      }%
                      }
                      lettikz@preaction@layer=pgfutil@empty
                      tikzset{preaction layer/.store in=tikz@preaction@layer}
                      makeatother

                      tikzset{
                      mpv/.style = {% multi part vertical (node)
                      rectangle split,
                      rectangle split parts=2,
                      rectangle split part fill={#1},
                      draw, rounded corners, text width=3cm,
                      align=center, text=white,
                      dsl},
                      dsl/.style = {preaction layer=background, drop shadow}, % <-- this put drop shadow on background layer
                      }

                      begin{document}
                      begin{tikzpicture}[node distance = 2mm]
                      %CONSOLE
                      node (n1) [mpv=black!70]
                      {
                      textbf{Console}
                      nodepart{two} Benutzereingaben
                      };
                      node (n2) [mpv={red,blue}, below=of n1]
                      {
                      textbf{Funktionen}
                      nodepart[align=left]{two} verb+Scripts+ \
                      verb+Format+ \
                      verb+getScripts+ \
                      verb+getCode+
                      };
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer























                      • Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
                        – Nusserdt
                        21 hours ago






                      • 1




                        @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
                        – Zarko
                        18 hours ago
















                      7














                      in year 2010 Mark Wibrow suggested me (for the similar problem) the hack which enable correct dropping show at custom fill of multi part node shape. using it in your (now really) mwe is:



                      documentclass[tikz, margin=3mm]{standalone}
                      usetikzlibrary{positioning,
                      shadows,
                      shapes.multipart}
                      pgfdeclarelayer{foreground}
                      pgfdeclarelayer{background}
                      pgfsetlayers{background,main,foreground}
                      makeatletter
                      deftikz@extra@preaction#1{% suggested Mark Wibrow on c.t.t. (2010)
                      {%
                      pgfsys@beginscope%
                      setboxtikz@figbox=boxvoidb@x%
                      begingrouptikzset{#1}expandafterendgroup%
                      expandafterdefexpandaftertikz@preaction@layer
                      expandafter{tikz@preaction@layer}%
                      ifxtikz@preaction@layerpgfutil@empty%
                      path[#1];% do extra path
                      else%
                      begin{pgfonlayer}{tikz@preaction@layer}%
                      path[#1];%
                      end{pgfonlayer}
                      fi%
                      pgfsyssoftpath@setcurrentpathtikz@actions@path% restore
                      tikz@restorepathsize%
                      pgfsys@endscope%
                      }%
                      }
                      lettikz@preaction@layer=pgfutil@empty
                      tikzset{preaction layer/.store in=tikz@preaction@layer}
                      makeatother

                      tikzset{
                      mpv/.style = {% multi part vertical (node)
                      rectangle split,
                      rectangle split parts=2,
                      rectangle split part fill={#1},
                      draw, rounded corners, text width=3cm,
                      align=center, text=white,
                      dsl},
                      dsl/.style = {preaction layer=background, drop shadow}, % <-- this put drop shadow on background layer
                      }

                      begin{document}
                      begin{tikzpicture}[node distance = 2mm]
                      %CONSOLE
                      node (n1) [mpv=black!70]
                      {
                      textbf{Console}
                      nodepart{two} Benutzereingaben
                      };
                      node (n2) [mpv={red,blue}, below=of n1]
                      {
                      textbf{Funktionen}
                      nodepart[align=left]{two} verb+Scripts+ \
                      verb+Format+ \
                      verb+getScripts+ \
                      verb+getCode+
                      };
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer























                      • Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
                        – Nusserdt
                        21 hours ago






                      • 1




                        @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
                        – Zarko
                        18 hours ago














                      7












                      7








                      7






                      in year 2010 Mark Wibrow suggested me (for the similar problem) the hack which enable correct dropping show at custom fill of multi part node shape. using it in your (now really) mwe is:



                      documentclass[tikz, margin=3mm]{standalone}
                      usetikzlibrary{positioning,
                      shadows,
                      shapes.multipart}
                      pgfdeclarelayer{foreground}
                      pgfdeclarelayer{background}
                      pgfsetlayers{background,main,foreground}
                      makeatletter
                      deftikz@extra@preaction#1{% suggested Mark Wibrow on c.t.t. (2010)
                      {%
                      pgfsys@beginscope%
                      setboxtikz@figbox=boxvoidb@x%
                      begingrouptikzset{#1}expandafterendgroup%
                      expandafterdefexpandaftertikz@preaction@layer
                      expandafter{tikz@preaction@layer}%
                      ifxtikz@preaction@layerpgfutil@empty%
                      path[#1];% do extra path
                      else%
                      begin{pgfonlayer}{tikz@preaction@layer}%
                      path[#1];%
                      end{pgfonlayer}
                      fi%
                      pgfsyssoftpath@setcurrentpathtikz@actions@path% restore
                      tikz@restorepathsize%
                      pgfsys@endscope%
                      }%
                      }
                      lettikz@preaction@layer=pgfutil@empty
                      tikzset{preaction layer/.store in=tikz@preaction@layer}
                      makeatother

                      tikzset{
                      mpv/.style = {% multi part vertical (node)
                      rectangle split,
                      rectangle split parts=2,
                      rectangle split part fill={#1},
                      draw, rounded corners, text width=3cm,
                      align=center, text=white,
                      dsl},
                      dsl/.style = {preaction layer=background, drop shadow}, % <-- this put drop shadow on background layer
                      }

                      begin{document}
                      begin{tikzpicture}[node distance = 2mm]
                      %CONSOLE
                      node (n1) [mpv=black!70]
                      {
                      textbf{Console}
                      nodepart{two} Benutzereingaben
                      };
                      node (n2) [mpv={red,blue}, below=of n1]
                      {
                      textbf{Funktionen}
                      nodepart[align=left]{two} verb+Scripts+ \
                      verb+Format+ \
                      verb+getScripts+ \
                      verb+getCode+
                      };
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer














                      in year 2010 Mark Wibrow suggested me (for the similar problem) the hack which enable correct dropping show at custom fill of multi part node shape. using it in your (now really) mwe is:



                      documentclass[tikz, margin=3mm]{standalone}
                      usetikzlibrary{positioning,
                      shadows,
                      shapes.multipart}
                      pgfdeclarelayer{foreground}
                      pgfdeclarelayer{background}
                      pgfsetlayers{background,main,foreground}
                      makeatletter
                      deftikz@extra@preaction#1{% suggested Mark Wibrow on c.t.t. (2010)
                      {%
                      pgfsys@beginscope%
                      setboxtikz@figbox=boxvoidb@x%
                      begingrouptikzset{#1}expandafterendgroup%
                      expandafterdefexpandaftertikz@preaction@layer
                      expandafter{tikz@preaction@layer}%
                      ifxtikz@preaction@layerpgfutil@empty%
                      path[#1];% do extra path
                      else%
                      begin{pgfonlayer}{tikz@preaction@layer}%
                      path[#1];%
                      end{pgfonlayer}
                      fi%
                      pgfsyssoftpath@setcurrentpathtikz@actions@path% restore
                      tikz@restorepathsize%
                      pgfsys@endscope%
                      }%
                      }
                      lettikz@preaction@layer=pgfutil@empty
                      tikzset{preaction layer/.store in=tikz@preaction@layer}
                      makeatother

                      tikzset{
                      mpv/.style = {% multi part vertical (node)
                      rectangle split,
                      rectangle split parts=2,
                      rectangle split part fill={#1},
                      draw, rounded corners, text width=3cm,
                      align=center, text=white,
                      dsl},
                      dsl/.style = {preaction layer=background, drop shadow}, % <-- this put drop shadow on background layer
                      }

                      begin{document}
                      begin{tikzpicture}[node distance = 2mm]
                      %CONSOLE
                      node (n1) [mpv=black!70]
                      {
                      textbf{Console}
                      nodepart{two} Benutzereingaben
                      };
                      node (n2) [mpv={red,blue}, below=of n1]
                      {
                      textbf{Funktionen}
                      nodepart[align=left]{two} verb+Scripts+ \
                      verb+Format+ \
                      verb+getScripts+ \
                      verb+getCode+
                      };
                      end{tikzpicture}
                      end{document}


                      enter image description here







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited 21 hours ago

























                      answered 21 hours ago









                      Zarko

                      120k865156




                      120k865156












                      • Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
                        – Nusserdt
                        21 hours ago






                      • 1




                        @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
                        – Zarko
                        18 hours ago


















                      • Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
                        – Nusserdt
                        21 hours ago






                      • 1




                        @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
                        – Zarko
                        18 hours ago
















                      Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
                      – Nusserdt
                      21 hours ago




                      Uhh, that's nasty. But it works fine. I implemented with a function. thanks for your help. :-)
                      – Nusserdt
                      21 hours ago




                      1




                      1




                      @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
                      – Zarko
                      18 hours ago




                      @Nusserdt, what is nasty? the code is written in spirit of tikz, since Mark is one of its coauthors ... its use is very simply, clear and intuitive.
                      – Zarko
                      18 hours ago











                      3














                      How does casting shadows work? A path gets stored and reused (while shifted). You could just do the same on the background layer. My answer uses the use path trick.



                      %USER INTERFACE CLASS DIAGRAMM
                      documentclass{minimal}
                      usepackage[a4paper,margin=1cm,landscape]{geometry}
                      usepackage{tikz}
                      usepackage{xcolor}

                      %%%<
                      usepackage{verbatim}
                      usepackage[active,tightpage]{preview}
                      PreviewEnvironment{tikzpicture}
                      setlengthPreviewBorder{5pt}%
                      %%%>

                      begin{comment}
                      :Title: User Interface Class diagram
                      end{comment}

                      %COLORS
                      definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                      definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                      %WRITE CODE
                      deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                      defcode#1{texttt{#1}newline}
                      defcodeEnd#1{texttt{#1}}

                      usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds}
                      makeatletter % https://tex.stackexchange.com/a/38995/121799
                      tikzset{
                      use path/.code={pgfsyssoftpath@setcurrentpath{#1}}
                      }
                      makeatother

                      begin{document}
                      tikzset{abstract/.style={rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
                      text centered, anchor=north, text=white, text width=3cm},
                      comment/.style={rectangle, draw=black, rounded corners,
                      text centered, anchor=north, text=white, text width=3cm},
                      myarrow/.style={->, >=open triangle 90, thick},
                      line/.style={-, thick}}

                      begin{center}
                      begin{tikzpicture}[node distance=3.8cm]
                      node [text width=4cm] at (-7,0) {title{Interface}};

                      node (Client) [abstract, rectangle split, rectangle split parts=2]
                      {
                      textbf{Client}
                      nodepart{second}Schnittstellen
                      };

                      %NODE LEVEL 01
                      node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                      %CONSOLE
                      node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                      {
                      textbf{Console}
                      nodepart{second}Benutzereingaben
                      };
                      node (Console_Comment)
                      [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue},
                      save path=tmpath, below=0.2cm of Console, text justified]
                      {
                      textbf{Funktionen}
                      nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                      };
                      begin{scope}[on background layer]
                      fill[black!50,opacity=0.5,
                      use path=tmpath,transform canvas={xshift=0.5ex,yshift=-0.5ex}];
                      end{scope}
                      end{tikzpicture}
                      end{center}
                      end{document}


                      enter image description here






                      share|improve this answer


























                        3














                        How does casting shadows work? A path gets stored and reused (while shifted). You could just do the same on the background layer. My answer uses the use path trick.



                        %USER INTERFACE CLASS DIAGRAMM
                        documentclass{minimal}
                        usepackage[a4paper,margin=1cm,landscape]{geometry}
                        usepackage{tikz}
                        usepackage{xcolor}

                        %%%<
                        usepackage{verbatim}
                        usepackage[active,tightpage]{preview}
                        PreviewEnvironment{tikzpicture}
                        setlengthPreviewBorder{5pt}%
                        %%%>

                        begin{comment}
                        :Title: User Interface Class diagram
                        end{comment}

                        %COLORS
                        definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                        definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                        %WRITE CODE
                        deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                        defcode#1{texttt{#1}newline}
                        defcodeEnd#1{texttt{#1}}

                        usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds}
                        makeatletter % https://tex.stackexchange.com/a/38995/121799
                        tikzset{
                        use path/.code={pgfsyssoftpath@setcurrentpath{#1}}
                        }
                        makeatother

                        begin{document}
                        tikzset{abstract/.style={rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
                        text centered, anchor=north, text=white, text width=3cm},
                        comment/.style={rectangle, draw=black, rounded corners,
                        text centered, anchor=north, text=white, text width=3cm},
                        myarrow/.style={->, >=open triangle 90, thick},
                        line/.style={-, thick}}

                        begin{center}
                        begin{tikzpicture}[node distance=3.8cm]
                        node [text width=4cm] at (-7,0) {title{Interface}};

                        node (Client) [abstract, rectangle split, rectangle split parts=2]
                        {
                        textbf{Client}
                        nodepart{second}Schnittstellen
                        };

                        %NODE LEVEL 01
                        node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                        %CONSOLE
                        node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                        {
                        textbf{Console}
                        nodepart{second}Benutzereingaben
                        };
                        node (Console_Comment)
                        [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue},
                        save path=tmpath, below=0.2cm of Console, text justified]
                        {
                        textbf{Funktionen}
                        nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                        };
                        begin{scope}[on background layer]
                        fill[black!50,opacity=0.5,
                        use path=tmpath,transform canvas={xshift=0.5ex,yshift=-0.5ex}];
                        end{scope}
                        end{tikzpicture}
                        end{center}
                        end{document}


                        enter image description here






                        share|improve this answer
























                          3












                          3








                          3






                          How does casting shadows work? A path gets stored and reused (while shifted). You could just do the same on the background layer. My answer uses the use path trick.



                          %USER INTERFACE CLASS DIAGRAMM
                          documentclass{minimal}
                          usepackage[a4paper,margin=1cm,landscape]{geometry}
                          usepackage{tikz}
                          usepackage{xcolor}

                          %%%<
                          usepackage{verbatim}
                          usepackage[active,tightpage]{preview}
                          PreviewEnvironment{tikzpicture}
                          setlengthPreviewBorder{5pt}%
                          %%%>

                          begin{comment}
                          :Title: User Interface Class diagram
                          end{comment}

                          %COLORS
                          definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                          definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                          %WRITE CODE
                          deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                          defcode#1{texttt{#1}newline}
                          defcodeEnd#1{texttt{#1}}

                          usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds}
                          makeatletter % https://tex.stackexchange.com/a/38995/121799
                          tikzset{
                          use path/.code={pgfsyssoftpath@setcurrentpath{#1}}
                          }
                          makeatother

                          begin{document}
                          tikzset{abstract/.style={rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
                          text centered, anchor=north, text=white, text width=3cm},
                          comment/.style={rectangle, draw=black, rounded corners,
                          text centered, anchor=north, text=white, text width=3cm},
                          myarrow/.style={->, >=open triangle 90, thick},
                          line/.style={-, thick}}

                          begin{center}
                          begin{tikzpicture}[node distance=3.8cm]
                          node [text width=4cm] at (-7,0) {title{Interface}};

                          node (Client) [abstract, rectangle split, rectangle split parts=2]
                          {
                          textbf{Client}
                          nodepart{second}Schnittstellen
                          };

                          %NODE LEVEL 01
                          node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                          %CONSOLE
                          node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                          {
                          textbf{Console}
                          nodepart{second}Benutzereingaben
                          };
                          node (Console_Comment)
                          [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue},
                          save path=tmpath, below=0.2cm of Console, text justified]
                          {
                          textbf{Funktionen}
                          nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                          };
                          begin{scope}[on background layer]
                          fill[black!50,opacity=0.5,
                          use path=tmpath,transform canvas={xshift=0.5ex,yshift=-0.5ex}];
                          end{scope}
                          end{tikzpicture}
                          end{center}
                          end{document}


                          enter image description here






                          share|improve this answer












                          How does casting shadows work? A path gets stored and reused (while shifted). You could just do the same on the background layer. My answer uses the use path trick.



                          %USER INTERFACE CLASS DIAGRAMM
                          documentclass{minimal}
                          usepackage[a4paper,margin=1cm,landscape]{geometry}
                          usepackage{tikz}
                          usepackage{xcolor}

                          %%%<
                          usepackage{verbatim}
                          usepackage[active,tightpage]{preview}
                          PreviewEnvironment{tikzpicture}
                          setlengthPreviewBorder{5pt}%
                          %%%>

                          begin{comment}
                          :Title: User Interface Class diagram
                          end{comment}

                          %COLORS
                          definecolor{Recessive}{RGB}{77, 87, 98} %BLUE
                          definecolor{Dominant}{RGB}{229, 126, 49} %ORANGE

                          %WRITE CODE
                          deftitle#1{Klassendiagramm:smallbreak fontsize{14}{14}textbf{texttt{#1}}}
                          defcode#1{texttt{#1}newline}
                          defcodeEnd#1{texttt{#1}}

                          usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds}
                          makeatletter % https://tex.stackexchange.com/a/38995/121799
                          tikzset{
                          use path/.code={pgfsyssoftpath@setcurrentpath{#1}}
                          }
                          makeatother

                          begin{document}
                          tikzset{abstract/.style={rectangle, draw=black, rounded corners, fill=Recessive, drop shadow,
                          text centered, anchor=north, text=white, text width=3cm},
                          comment/.style={rectangle, draw=black, rounded corners,
                          text centered, anchor=north, text=white, text width=3cm},
                          myarrow/.style={->, >=open triangle 90, thick},
                          line/.style={-, thick}}

                          begin{center}
                          begin{tikzpicture}[node distance=3.8cm]
                          node [text width=4cm] at (-7,0) {title{Interface}};

                          node (Client) [abstract, rectangle split, rectangle split parts=2]
                          {
                          textbf{Client}
                          nodepart{second}Schnittstellen
                          };

                          %NODE LEVEL 01
                          node (Level01) [text width=4cm, below=2.5cm of Client] {}; %LEVEL 01

                          %CONSOLE
                          node (Console) [abstract, rectangle split, rectangle split parts=2, left=of Level01]
                          {
                          textbf{Console}
                          nodepart{second}Benutzereingaben
                          };
                          node (Console_Comment)
                          [comment, rectangle split, rectangle split parts=2, rectangle split part fill={red,blue},
                          save path=tmpath, below=0.2cm of Console, text justified]
                          {
                          textbf{Funktionen}
                          nodepart{second}code{Scripts} code{Format} code{getScripts} codeEnd{getCode}
                          };
                          begin{scope}[on background layer]
                          fill[black!50,opacity=0.5,
                          use path=tmpath,transform canvas={xshift=0.5ex,yshift=-0.5ex}];
                          end{scope}
                          end{tikzpicture}
                          end{center}
                          end{document}


                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 18 hours ago









                          marmot

                          85.9k499183




                          85.9k499183






















                              Nusserdt is a new contributor. Be nice, and check out our Code of Conduct.










                              draft saved

                              draft discarded


















                              Nusserdt is a new contributor. Be nice, and check out our Code of Conduct.













                              Nusserdt is a new contributor. Be nice, and check out our Code of Conduct.












                              Nusserdt is a new contributor. Be nice, and check out our Code of Conduct.
















                              Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f467258%2fhow-to-fill-a-split-node-with-two-different-colors%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              What visual should I use to simply compare current year value vs last year in Power BI desktop

                              Alexandru Averescu

                              Trompette piccolo