Here is my take:
Update: More "bling bling", more compilation time... (and trying @Stefan's brilliant idea)
Update 2 Thanks to Stefan, I have seen that the previous version was only working in the QtikZ environment but nowhere(I guess) else. For some reason beyond me, the fadings are still not displayed correctly in Adobe Reader but at least it works (almost) properly in SumatraPDF on Windows. Sorry for the inconvenience and Happy New Year everyone!
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.pathmorphing}
\pgfdeclareradialshading{someshade}{\pgfpointorigin}{color(0mm)=(pgftransparent!40);color(4mm)=(pgftransparent!50);color(8mm)=(pgftransparent!70);color(2cm)=(pgftransparent!100)}
\pgfdeclareradialshading{somenodeshade}{\pgfpointorigin}{color(0mm)=(pgftransparent!0);color(2mm)=(pgftransparent!0);color(5mm)=(pgftransparent!99);color(20mm)=(pgftransparent!100)}
\pgfdeclareradialshading{invertshade}{\pgfpointorigin}{color(0mm)=(pgftransparent!100);color(10mm)=(pgftransparent!95);color(16mm)=(pgftransparent!60);color(2cm)=(pgftransparent!0)}
\pgfdeclarefading{fadeit}{\pgfuseshading{someshade}}
\pgfdeclarefading{fadein}{\pgfuseshading{invertshade}}
\begin{document}
\begin{tikzpicture}[projectile/.style={decorate,decoration={random steps,segment length=2pt,amplitude=0.5pt}}]
\fill[black] (-4,-3) rectangle (6,4);
\begin{scope}[xshift=0cm,yshift=-0.4cm,transparency group]
\pgfsetfading{fadein}{\pgftransformshift{\pgfpointorigin}}
\foreach \x in {0,10,..., 360}{\draw[blue!80!white,projectile,line width=1.1pt] (0,0) to [in=90] (10*rand+\x:rand*1mm+2cm);};
\end{scope}
\begin{scope}[xshift=2cm,yshift=1cm]
\foreach \x in {0,12,..., 360}{\draw [yellow!5,thick,projectile] (0.7,0) to (3*rand+\x :1mm*rand+2.2cm) node%
[circle,inner sep=1mm,shade,shading=somenodeshade,opacity=1,outer sep=0] {};}
{\pgfsetfading{fadeit}{\pgftransformshift{\pgfpoint{2.5cm}{1cm}}}};\fill[white] (-3,-3) rectangle (3,3);
\end{scope}
\begin{scope}[xshift=3cm,yshift=-1cm]
\foreach \x in {0,10,..., 360}{\def\r1{rand}\draw [yellow] ($(0,0)!abs{\r1}!(\x :5mm)$) to [in=90] ($(0,0)!abs{\r1}+0.2!(\x :8mm)$);}
{\pgfsetfading{fadeit}{\pgftransformshift{\pgfpoint{3cm}{-1cm}}}};\fill[yellow,opacity=0.6] (-3,-3) rectangle (3,3);
\end{scope}
\begin{scope}[xshift=-1cm,yshift=1.5cm]
\foreach \x in {0,12,..., 360}{\def\r2{rand}\draw [red,line width=0.5pt] ($(0,0)!abs{\r2}!(\x :3mm)$) -- ($(0,0)!abs{\r2}+0.1!(\x :7mm)$);}
{\pgfsetfading{fadeit}{\pgftransformshift{\pgfpoint{-1cm}{1.5cm}}}};\fill[red,opacity=0.6] (-3,-3) rectangle (3,3);
\end{scope}
\end{tikzpicture}
\end{document}
and the updated code gives (see the history for the previous code)
With random
by D. Arsenau.
\documentclass{article}
\usepackage{xparse}
\input{random}
\ExplSyntaxOn
\cs_set_eq:NN \guid_set_random_number:Nnn \setrannum
\cs_set_eq:NN \g_guid_seed_int \randomi
\tl_new:N \l__guid_four_bytes_tl
\int_new:N \l__guid_random_int
\cs_new_protected:Nn \__guid_generate:n
{
\guid_set_random_number:Nnn \l__guid_random_int { 0 } { #1 }
\int_case:nn { #1 }
{
{ 4095 }{ \int_add:Nn \l__guid_random_int { "4000 } }
{ 16383 }{ \int_add:Nn \l__guid_random_int { 32768 } }
}
\tl_set:Nx \l__guid_four_bytes_tl { \int_to_Hex:n { \l__guid_random_int } }
\tl_set:Nx \l__guid_four_bytes_tl
{
\prg_replicate:nn { 4 - \tl_count:N \l__guid_four_bytes_tl } { 0 }
\tl_use:N \l__guid_four_bytes_tl
}
}
\NewDocumentCommand{\GUIDgenerate}{om}
{
\tl_new:c { g_guid_user_#2_tl }
\group_begin:
\IfValueT { #1 } { \int_gset:Nn \g_guid_seed_int { #1 } } % the seed
% Data 1 (eight bytes)
\__guid_generate:n { 65535 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
\__guid_generate:n { 65535 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
% hyphen
\tl_gput_right:cx { g_guid_user_#2_tl } { - }
% Data 2 (four bytes)
\__guid_generate:n { 65535 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
% hyphen
\tl_gput_right:cx { g_guid_user_#2_tl } { - }
% Data 3 (four bytes)
\__guid_generate:n { 4095 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
% hyphen
\tl_gput_right:cx { g_guid_user_#2_tl } { - }
% Data 4a (three bytes)
\__guid_generate:n { 16383 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
% hyphen
\tl_gput_right:cx { g_guid_user_#2_tl } { - }
% Data 4b (twelve bytes)
\__guid_generate:n { 65535 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
\__guid_generate:n { 65535 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
\__guid_generate:n { 65535 }
\tl_gput_right:cx { g_guid_user_#2_tl } { \l__guid_four_bytes_tl }
\group_end:
}
\DeclareExpandableDocumentCommand{\GUID}{m}
{
\tl_use:c { g_guid_user_#1_tl }
}
\ExplSyntaxOff
\GUIDgenerate{fooA}
\GUIDgenerate{fooB}
\GUIDgenerate{fooC}
\begin{document}
\ttfamily
\GUID{fooA}\par
\GUID{fooB}\par
\GUID{fooC}\par
\GUIDgenerate[2]{fooD}
\GUIDgenerate[3]{fooE}
\GUIDgenerate[42]{fooF}
\GUID{fooD}\par
\GUID{fooE}\par
\GUID{fooF}\par
\end{document}
If you compile this several times, you'll see that the first three GUIDs change, whereas the last three don't, because they're defined with a fixed seed.
Best Answer
Third version (via
pdflatex
usingClearSans
package)(Note:
ClearSans
package, version 2014-05-28)2nd version (using the Intel ClearSans font with help of
lualatex
)First version (default font and
pdflatex
)Here is a (completed) solution without
ifthen
package: