Wie fülle ich Logikgatter in Tikz mit Farbe?

Wie fülle ich Logikgatter in Tikz mit Farbe?

Mit welcher Farbe soll dieses ANDTor gefüllt werden? Bildbeschreibung hier eingeben

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.gates.logic.US}
\usetikzlibrary{circuits.ee.IEC}
\begin{document}
    \begin{tikzpicture}[ circuit symbol wires]
    \node (x) at (0,1) {$x$};
    \node (y) at (0,0) {$y$};
    \node[and gate US, minimum size=32pt, draw] at (1.5,0.5) (And) {};
    \draw (x.east) -- ++(right:3mm) |- (And.input 1);
    \draw (y.east) -- ++(right:3mm) |- (And.input 2);
    \draw (And.output) -- ($(And) + (1.5,0)$);
    \node (z) at ($(And) + (1.9,0)$) {$x\& y$};
    \end{tikzpicture}
\end{document}

Antwort1

Vielleicht so etwas:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.gates.logic.US}
\usetikzlibrary{circuits.ee.IEC}
\begin{document}
    \begin{tikzpicture}[ circuit symbol wires]
    \node (x) at (0,1) {$x$};
    \node (y) at (0,0) {$y$};
    \node[and gate US, minimum size=32pt, draw, fill =red] at (1.5,0.5) (And) {};
    \draw (x.east) -- ++(right:3mm) |- (And.input 1);
    \draw (y.east) -- ++(right:3mm) |- (And.input 2);
    \draw (And.output) -- ($(And) + (1.5,0)$);
    \node (z) at ($(And) + (1.9,0)$) {$x\& y$};
    \end{tikzpicture}
\end{document}

Dadurch erhalten Sie:

Bildbeschreibung hier eingeben

verwandte Informationen