In the previous post, I got help with creating boxes with black borders and custom fills.
How can I create other shapes like triangles, circles, rotated squares, etc. with custom fills.
I do not want to use tikz at this moment.
\documentclass[11pt,a4paper]{article}%
\usepackage{xcolor}
% some color definitions
\definecolor{cblue}{RGB}{16,78,139}
\definecolor{cred}{RGB}{139,37,0}
\definecolor{cgreen}{RGB}{0,139,0}
% normal box
\newcommand{\sqboxs}{1.2ex}% the square size
\newcommand{\sqboxf}{0.6pt}% the border in \sqboxEmpty
\newcommand{\sqbox}[1]{\textcolor{#1}{\rule{\sqboxs}{\sqboxs}}}
\newcommand{\sqboxblack}[1]{\setlength{\fboxsep}{0pt}\fbox{\sqbox{#1}}}
% empty box
\newcommand{\sqboxEmpty}[1]{%
\begingroup
\setlength{\fboxrule}{\sqboxf}%
\setlength{\fboxsep}{-\fboxrule}%
\textcolor{#1}{\fbox{\rule{0pt}{\sqboxs}\rule{\sqboxs}{0pt}}}%
\endgroup
}
\newcommand{\sqboxEmptyblack}[1]{\setlength{\fboxsep}{0pt}\fbox{\sqboxEmpty{#1}}}
\begin{document}
I like these.
\sqbox{cred} \sqbox{cgreen} \sqbox{cblue}
And also these.
\sqboxEmpty{cred} \sqboxEmpty{cgreen} \sqboxEmpty{cblue}
\end{document}
pstricks
orpst-poly
for regular polygons.