Skip to content

Instantly share code, notes, and snippets.

@seungwonpark
Created July 6, 2017 12:19
Show Gist options
  • Save seungwonpark/609ba6e6a00b134cd30cdf1a4d5bcf04 to your computer and use it in GitHub Desktop.
Save seungwonpark/609ba6e6a00b134cd30cdf1a4d5bcf04 to your computer and use it in GitHub Desktop.
JOI style profile picture
% !TeX program = lualatex
\RequirePackage{luatex85}
\documentclass{standalone}
\usepackage{tikz}
\usepackage{luacode}
\usepackage{graphicx}
\definecolor{joired}{RGB}{218,11,49}
\definecolor{joigreen}{RGB}{18,136,104}
\definecolor{joiyellow}{RGB}{250,210,49}
\definecolor{joiblue}{RGB}{15,105,180}
\definecolor{joiblack}{RGB}{0,0,1}
\begin{document}
\begin{tikzpicture}
\draw[white] (-8.2,8.2) rectangle (0.2,-0.2);
\luaexec{
s = {"joiblack", "joiblue", "joiyellow", "joigreen", "joired"}
tp=tex.print
two = {4}
gap = {0.2}
textscale = 1
for i=2,50 do
two[i] = two[i-1]*0.5
gap[i] = gap[i-1]*0.5
end
for i=1,15 do
tp("\\fill[" .. s[math.fmod(i+8,5)+1] .. "] (" .. (-2)*two[i] .. "," .. two[i]+gap[i] .. ") rectangle (" .. (-1)*two[i]-gap[i] .. "," .. 2*two[i] .. ");")
tp("\\fill[" .. s[math.fmod(i+5,5)+1] .. "] (" .. (-1)*two[i] .. "," .. two[i]+gap[i] .. ") rectangle (" .. 0 .. "," .. 2*two[i] .. ");")
tp("\\fill[" .. s[math.fmod(i+7,5)+1] .. "] (" .. (-2)*two[i] .. "," .. 0 .. ") rectangle (" .. (-1)*two[i]-gap[i] .. "," .. two[i] .. ");")
tp("\\node at (" .. (3*two[i]+gap[i])*(-0.5) .. "," .. (3*two[i]+gap[i])*(0.5) .. ") {\\includegraphics[width=" .. textscale*(two[i]-gap[i]) .. "cm]{park.png}};")
tp("\\node at (" .. (two[i])*(-0.5) .. "," .. (3*two[i]+gap[i])*(0.5) .. ") {\\includegraphics[width=" .. textscale*(two[i]-gap[i]) .. "cm]{seung.png}};")
tp("\\node at (" .. (3*two[i]+gap[i])*(-0.5) .. "," .. (two[i])*(0.5) .. ") {\\includegraphics[width=" .. textscale*(two[i]-gap[i]) .. "cm]{won.png}};")
end
}
\end{tikzpicture}
\end{document}
@seungwonpark
Copy link
Author

park.png
park

seung.png
seung

won.png
won

@Baekjoon
Copy link

choi
baek
joon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment