3

I want to make something like thisenter image description here

How can I do it?

Gary
  • 371

2 Answers2

6
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{patterns.meta}
\begin{document}
\begin{tikzpicture}
\fill[orange!50!yellow, postaction={pattern={Lines[angle=-45, distance=2mm, line width=1mm]}}] circle[radius=1cm];            
\end{tikzpicture}
\end{document}

Black and orange striped circle

Edit: The stripes are exact. Any bleed through of color is because of viewer artefacts. It is dependent on the viewer used and dependent on zoom level. It is impossible to totally avoid when there are three colors involved - black, orange and background white.

One possibility is to make orange stripes only a little wider than the black stripes, instead of a full orange circle, so the effect is only at a small distance.

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{patterns.meta}
\begin{document}
\begin{tikzpicture}
\fill[pattern={Lines[angle=-45, distance=2mm, line width=1.1mm, xshift=1.4mm]},  pattern color=orange!50!yellow] circle[radius=1cm];            
\fill[pattern={Lines[angle=-45, distance=2mm, line width=1mm]}] circle[radius=1cm];            
\end{tikzpicture}
\end{document}
  • 1
    Looks nice, but there are some yellow dashes spanning the width of the black stripes both in your image and in the result after I compile your code. – Gary Aug 11 '22 at 19:11
  • 1
    No there are not - see edit and try to zoom in or use an other viewer. – hpekristiansen Aug 11 '22 at 22:04
  • How can I change the the stripe colors from yellow/black to red/blue? I tried "red!50!blue" but the result looks pretty bad. – Gary Aug 12 '22 at 15:13
  • 1
    @Gary Use \fill[blue, pattern color=red, …. The \fill will default to black in this case. With red!50!blue you just specify a mixed color. – Qrrbrbirlbel Oct 08 '22 at 21:28
5

You need not Tikz, if you are using OpTeX. You can do something like this:

\hbox{\clipincircle 5mm 5mm 10mm 10mm{%
\pdfsave\pdfrotate{-45}%
   \rlap{\kern-5mm
     \vbox{\fornum 1..10\do {\hrule width5cm height2pt {\Yellow \hrule height2pt}}}}%
\pdfrestore
}}

\bye

wipet
  • 74,238
  • 2
    Why the downvotes? Does the solution not work? (I can not test it as I do not have OpTeX) – hpekristiansen Aug 11 '22 at 22:24
  • 2
    I show that we don't need to use TikZ for simple tasks like lines in a circle. TeX format didn't be specified by OP. You cannot suppose that this format is LaTeX. – wipet Aug 12 '22 at 05:33