考虑一下代码
\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}
产生
我使用双印星号来制作星星。(还有更好的方法吗?)
问:怎样才能在星星周围产生“发光”效果?
谢谢。
答案1
这是一个使用tikz
和 的想法。在 中调用的fadings
命令将在给定的坐标处创建一颗发光的星星。\glowstar[<size>]{x,y}
tikzpicture
\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}