2

Consider the code

\documentclass[a5paper,12pt,onecolumn,openany,final]{book}
\usepackage[hmargin=0.7in,vmargin=0.75in]{geometry}
\usepackage{pstricks,psvectorian}
\usepackage{color}
\usepackage{scalefnt}

% % % Compiled with Xelatex

\begin{document}
\thispagestyle{empty}

\begin{pspicture}(-5,-5)(5,12)%
\renewcommand*{\psvectorianDefaultColor}{blue}%

\psframe[fillcolor=blue,fillstyle=solid](-5,-5)(5,12) %Used with colored frame 
\psframe[linecolor=blue](-5,-5)(5,12)% draws frame in black.
%top and bottom center

\large

\rput(0,3){\textbf{\scalebox{0.92}{\textcolor{white}{HOW TO MAKE THE STARS GLOW?}}}}

\rput(0,9.25){\color{white}{\huge{\textbf{*}}}}
\rput(0.03,9.25){\color{white}{\huge{\textbf{*}}}}
\rput(-2.25,5.75){\color{white}{\huge{\textbf{*}}}}
\rput(-2.25,5.75){\color{white}{\huge{\textbf{*}}}}
\rput(3.25,7){\color{white}{\huge{\textbf{*}}}}
\rput(3.25,7){\color{white}{\huge{\textbf{*}}}}
\end{pspicture}%
\end{document}

which produces

enter image description here

I have used doubly-imprinted asterisks to produce the stars. (Might there be a better way?)

QUESTION: How may I produce a ``glow'' effect around the stars?

Thank you.

1 Answer 1

6

Here is an idea using tikz and fadings. The command \glowstar[<size>]{x,y} called inside a tikzpicture will make a glowing star at the given coordinates.

enter image description here

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{fadings, calc}
\tikzfading[name=dim fade, inner color=transparent!50, outer color=transparent!100]
\tikzfading[name=bright fade, right color=transparent!100, left color=transparent!100, middle color=transparent!0]

\newcommand{\glowstar}[2][.5]{\fill[white,path fading=dim fade](#2)circle[radius=#1*.4];
    \foreach \t in {0,60,120}{
    \fill[rotate around={\t:(#2)}, white,path fading=bright fade]($(#2)-(.9*#1,0)$)--($(#2)-(0,.02*#1)$)--($(#2)+(.9*#1,0)$)--($(#2)+(0,.02*#1)$)--cycle;
    \fill[rotate around={\t:(#2)}, white,path fading=bright fade]($(#2)-(.3*#1,0)$)--($(#2)-(0,.04*#1)$)--($(#2)+(.3*#1,0)$)--($(#2)+(0,.04*#1)$)--cycle;}
    \fill[white] (#2)circle[radius=#1*.075];
    }

\begin{document}

\begin{tikzpicture}
\fill[blue] rectangle (4,2);
\glowstar[.5]{2,1}
\glowstar[.2]{1,1.5}
\glowstar[.3]{3,.5}
\end{tikzpicture}

\end{document}
9
  • Thank you. This is quite nice!
    – DDS
    May 11, 2022 at 21:28
  • Is there a way to generate these stars when compiling with xelatex? When I incorporate your code in conjunction with my pspicture code, and compile it with xelatex (as I must do) in the actual document---the "glow" disappears. Thanks again.
    – DDS
    May 12, 2022 at 13:45
  • @mlchristians: I'm not an expert with pstricks, so I don't know if it supports some version of fadings, but you can use TikZ with XeLaTeX. Can you switch the rest of the diagram to TikZ?
    – Sandy G
    May 12, 2022 at 21:16
  • Thank you for your response. Unfortunately, I must compile the document in question with xelatex.
    – DDS
    May 13, 2022 at 19:40
  • @mlchristians: It's no problem using TikZ with XeLaTeX. Is there a reason you can't use TikZ for your star diagram?
    – Sandy G
    May 13, 2022 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .