Edit and compile if you like:
\documentclass[border=2pt]{standalone}%Drawing\usepackage{tikz}\tikzset{>=latex}\usetikzlibrary{calc, decorations.markings}%Styles%%Arrow in the Middle\tikzset{arrow inside/.style = {postaction=decorate,decoration={markings,mark=at position 0.52 with \arrow{stealth}}}}% Colors\definecolor{glass}{cmyk}{0.2,0,0,0}% Newcommand%% Mid Line Label\newcommand{\midlabelline}[3]{\node (midlabel) at ($ (#1)!.5!(#2) $) {#3};\draw[<-] (#1) -- (midlabel);\draw[->] (midlabel) -- (#2);}\begin{document}\begin{tikzpicture}[scale=2]% Grid% \draw[help lines] (-1,-2) grid (4,2);% \foreach \i in {0,0.5,1,1.5,...,5}% {% \node at (\i,-2ex) {$\i$};% }% Lens\path[fill=glass, draw=black, line width = 0.6] (1,-2) .. controls (0.8,0) .. (1,2) .. controls (1.2,0) .. (1,-2);% Rays\draw[black!40, line width = 0.6, arrow inside] (0,1.25) -- (1,1.25) node[above, pos=0.5, black] {\small light ray};%\draw[red, line width = 0.6, arrow inside] (1,1.25) -- (3.7,-0.3);\draw[green, line width = 0.6, arrow inside] (1,1.25) -- (3,-0.3);\draw[blue, line width = 0.6, arrow inside] (1,1.25) -- (2.3,-0.3);
Click to download: lens-colors.tex
Open in Overleaf: lens-colors.tex
This file is available on GitHub.
See more on the author page of Alexandros Tsagkaropolulos.