## Update
Wenn man den Vorschlag von esdd auf das Beispiel umsetzt, liegen die Füllflächen leider über der inneren Hälfte der Umrandungslinien. Um dies zu umgehen kann man mit `\tikz@mode` die Zeichenmodi laden und mit `\iftikz@mode@draw` überprüfen, ob nur gefüllt oder auch gezeichnet werden soll.<sup>1</sup>
Wahrscheinlich kann man die Teile, die im `\beforebackgroundpath` sind, aus dem `\backgroundpath` entfernen.
<sup>1</sup>: Vielleicht muss man die Modes noch wieder deaktivieren, um unvorhersehbares Verhalten zu vermeiden. Bitte um Rückmeldung.
### Code
\documentclass[paper=20cm:10cm, pagesize]{scrartcl}
\usepackage{tikz}
\pagestyle{empty}
\makeatletter
\pgfdeclareshape{computer}{%
% inherit anchors
\inheritsavedanchors[from=rectangle]
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
\backgroundpath{
%%% DRAW OUTLINE OF SHAPE %%%
% store lower left in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% move to point xb/yb (north east)
\pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@yb}}
% draw a line between upper right (xb,yb) and upper left (xa,yb)
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{.2\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xa}{.2\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xa}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xb}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xb}{.2\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.2\pgf@ya}}
\pgfpathclose
%%% DRAW SCREEN %%%
\pgfpathmoveto{\pgfpoint{.85\pgf@xb}{.85\pgf@yb}}
\pgfpathlineto{\pgfpoint{.85\pgf@xa}{.85\pgf@yb}}
\pgfpathlineto{\pgfpoint{.85\pgf@xa}{.05\pgf@ya}}
\pgfpathlineto{\pgfpoint{.85\pgf@xb}{.05\pgf@ya}}
\pgfpathclose
%%% DRAW UPPER RECTANGLE OF CASE %%%
\pgfpathmoveto{\pgfpoint{\pgf@xa}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.5\pgf@ya}}
\pgfpathclose
%%% DRAW LEFT TRIANGLE %%%
\pgfpathmoveto{\pgfpoint{\pgf@xa}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{.5\pgf@xa}{\pgf@ya}}
\pgfpathclose
%%% DRAW RIGHT TRIANGLE %%%
\pgfpathmoveto{\pgfpoint{\pgf@xb}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{.5\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
}
\beforebackgroundpath{
\tikz@mode% installs the mode settings
%%% FILL SCREEN %%%
\pgfpathmoveto{\pgfpoint{.85\pgf@xb}{.85\pgf@yb}}
\pgfpathlineto{\pgfpoint{.85\pgf@xa}{.85\pgf@yb}}
\pgfpathlineto{\pgfpoint{.85\pgf@xa}{.05\pgf@ya}}
\pgfpathlineto{\pgfpoint{.85\pgf@xb}{.05\pgf@ya}}
\pgfpathclose
\pgfsetfillcolor{black}
\iftikz@mode@draw% fill and stroke if draw is choosen
\pgfusepath{fill, stroke}
\else% fill only if draw is not choosen
\pgfusepath{fill}
\fi
%%% FILL LEFT TRIANGLE %%%
\pgfpathmoveto{\pgfpoint{\pgf@xa}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{.5\pgf@xa}{\pgf@ya}}
\pgfpathclose
%%% DRAW RIGHT TRIANGLE %%%
\pgfpathmoveto{\pgfpoint{\pgf@xb}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{.5\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
\pgfsetfillcolor{gray}
\iftikz@mode@draw
\pgfusepath{fill, stroke}
\else
\pgfusepath{fill}
\fi
}
}
\makeatother
\tikzset{
shape example/.style={
color=black!30,
draw,
fill=yellow!30,
line width=.1cm,
inner xsep=2.5cm,
inner ysep=2.5cm
}
}
\begin{document}
\begin{tikzpicture}
\node[shape example, computer, name=s] at (0,0) {};
\foreach \anchor/\placement in {north/above, west/left, east/right, south/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\draw[shift=(s.center), white] plot[mark=x] coordinates{(0,0)} node[above] {\scriptsize\texttt{(s.center)}};
\begin{scope}[xshift=8cm]
\node[shape example, computer, name=s, draw=none] at (0,0) {};
\foreach \anchor/\placement in {north/above, west/left, east/right, south/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\draw[shift=(s.center), white] plot[mark=x] coordinates{(0,0)} node[above] {\scriptsize\texttt{(s.center)}};
\end{scope}
\end{tikzpicture}
\end{document}
### Ergebnis
![Ergebnis][1]
----
Ursprüngliche Antwort:
### Pfade benutzen
Du musst die Pfade benutzen, wenn sie fertig sind. PGF scheint dies am Ende automatisch zu tun. Wenn du einzelne Teile unterschiedlich verwenden willst, musst du das aber explizit tun. Dafür dient `\pgfusepath{stroke}`.
### Nur die Füllfarbe definieren
Die Füllfarbe solltest du mit `\pgfsetfillcolor` setzten. `\color` setzt ebenfalls die Strichfarbe.
### Code
\documentclass[a5paper, pagesize]{scrartcl}
\usepackage{tikz}
\makeatletter
\pgfdeclareshape{computer}{%
% inherit anchors
\inheritsavedanchors[from=rectangle]
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
\backgroundpath{
%%% DRAW OUTLINE OF SHAPE %%%
% store lower left in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
% move to point xb/yb (north east)
\pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@yb}}
% draw a line between upper right (xb,yb) and upper left (xa,yb)
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{.2\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xa}{.2\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xa}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xb}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{.3\pgf@xb}{.2\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.2\pgf@ya}}
\pgfpathclose
\pgfusepath{stroke}
%%% DRAW SCREEN %%%
\pgfsetfillcolor{black}
\pgfpathmoveto{\pgfpoint{.85\pgf@xb}{.85\pgf@yb}}
\pgfpathlineto{\pgfpoint{.85\pgf@xa}{.85\pgf@yb}}
\pgfpathlineto{\pgfpoint{.85\pgf@xa}{.05\pgf@ya}}
\pgfpathlineto{\pgfpoint{.85\pgf@xb}{.05\pgf@ya}}
\pgfpathclose
\pgfusepath{fill,stroke}
%%% DRAW UPPER RECTANGLE OF CASE %%%
\pgfpathmoveto{\pgfpoint{\pgf@xa}{.5\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{.5\pgf@ya}}
\pgfpathclose
\pgfusepath{stroke}
%%% DRAW LEFT TRIANGLE %%%
\pgfsetfillcolor{gray}
\pgfpathmoveto{\pgfpoint{\pgf@xa}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{.5\pgf@xa}{\pgf@ya}}
\pgfpathclose
\pgfusepath{fill,stroke}
%%% DRAW RIGHT TRIANGLE %%%
\pgfsetfillcolor{gray}
\pgfpathmoveto{\pgfpoint{\pgf@xb}{.65\pgf@ya}}
\pgfpathlineto{\pgfpoint{.5\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
\pgfusepath{fill,stroke}
}
}
\makeatother
\tikzset{
shape example/.style={
color=black!30,
draw,
fill=yellow!30,
line width=.1cm,
inner xsep=2.5cm,
inner ysep=2.5cm
}
}
\begin{document}
\begin{tikzpicture}
\node[shape example, computer, name=s] at (0,0) {};
\foreach \anchor/\placement in {north/above, west/left, east/right, south/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\draw[shift=(s.center), white] plot[mark=x] coordinates{(0,0)} node[above] {\scriptsize\texttt{(s.center)}};
\end{tikzpicture}
\end{document}
### Ergebnis
![Ergebnis][1]
[1]: https://88df6ea0630aed8027ff-0caf779119a6537399728d4d80523795.ssl.cf5.rackcdn.com/qkjchmvjfmqv/page/b63c69d1b1aba6af85364624ae1c8fc2981ff902.jpeghttps://88df6ea0630aed8027ff-0caf779119a6537399728d4d80523795.ssl.cf5.rackcdn.com/gqgcbhgkycdt/page/ef40a287f715d2ef1ede021f3bf9bb27485b80c1.jpeg