答案1
希望这已经足够接近了。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{expl3}
\usepackage{etoolbox}
\usetikzlibrary{shapes.misc, fadings}
\begin{document}
\ExplSyntaxOn
\clist_new:N \g_enum_colors_clist
\clist_gset:Nn \g_enum_colors_clist {
ff7a01, 1a428a, 080808, fe065a,
007541, fd2300, 5f5f5f, d00204,
0282fd, 4c1278, 229118, 02195f
}
\int_new:N \g_enum_count_int
\newcommand{\resetenumcount}{
\int_gset:Nn \g_enum_count_int {1}
}
\newcommand{\increnumcount}{
\int_gincr:N \g_enum_count_int
\int_compare:nNnT {\g_enum_count_int} > {\clist_count:N \g_enum_colors_clist} {
\resetenumcount
}
}
\cs_set_eq:NN \define_color:nnn \definecolor
\cs_generate_variant:Nn \define_color:nnn {nno}
\newcommand{\setenumcolor}{
\tl_set:Nx \l_tmpa_tl {\clist_item:Nn \g_enum_colors_clist {\g_enum_count_int}}
\define_color:nno {enumcolor}{HTML}{\l_tmpa_tl}
}
\AtBeginEnvironment{enumerate}{
\resetenumcount
}
\ExplSyntaxOff
\pgfdeclarelayer{bg} % declare background layer
\pgfsetlayers{bg,main} % set the order of the layers (main is the standard layer)
\newcommand{\blpt}[1]{%
\setenumcolor\increnumcount%
\raisebox{-1ex}{%
\begin{tikzpicture}%
\node[circle, fill=white, inner sep=1pt] (num) at (0mm, 0mm) {\fontfamily{qhv}\small\selectfont\bfseries #1};
\begin{pgfonlayer}{bg}
\node[rounded rectangle,
minimum width=3.2em,
minimum height=1.8em,
xshift=-0.3em,
shading = axis,
shading angle=135,
left color=enumcolor,
right color=enumcolor!40!white
] (num) at (0mm, 0mm) {};
\end{pgfonlayer}
\end{tikzpicture}}%
}
\begin{minipage}{0.45\linewidth}
\begin{enumerate}[label=\protect\blpt{\arabic*}]
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\end{enumerate}
\end{minipage}
\begin{minipage}{0.45\linewidth}
\begin{enumerate}[label=\protect\blpt{\arabic*}]
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\end{enumerate}
\end{minipage}
\end{document}
答案2
她是一个稍微修改过的版本,基于@AlanXiang 的回答。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{xcolor}
%\usepackage{expl3} % since latex 2020-02, expl3 is packed in latex
\usepackage{etoolbox}
\usepackage{multicol}
\usetikzlibrary{fadings}
\ExplSyntaxOn
\clist_new:N \c_enum_colors_clist
\clist_gset:Nn \c_enum_colors_clist {
ff7a01, 1a428a, 080808, fe065a,
007541, fd2300, 5f5f5f, d00204,
0282fd, 4c1278, 229118, 02195f
}
\int_new:N \c_enum_color_count_int
\int_set:Nn \c_enum_color_count_int {\clist_count:N \c_enum_colors_clist}
\int_new:N \l_enum_count_int
\newcommand{\resetenumcount}{
\int_gset:Nn \l_enum_count_int {1}
}
\newcommand{\increnumcount}{
\int_gincr:N \l_enum_count_int
\int_compare:nNnT {\l_enum_count_int} > {\c_enum_color_count_int} {
\resetenumcount
}
}
\newcommand{\setenumcolor}{
\exp_args:Nnnx \definecolor {enumcolor} {HTML}
{ \clist_item:Nn \c_enum_colors_clist {\l_enum_count_int} }
}
\AtBeginEnvironment{enumerate}{
\resetenumcount
}
\ExplSyntaxOff
\def\enumwd{1.35em} % half the width of rounded rectangle
\def\enumht{.9em} % half the height
\newcommand{\blpt}[1]{%
\setenumcolor\increnumcount
\begin{tikzpicture}[baseline=(num.base)]
\fill[
rounded corners=.9em,
left color=enumcolor,
right color=enumcolor!40!white
] (0, 0) rectangle (2*\enumwd, 2*\enumht);
\coordinate (o) at (2*\enumwd-\enumht, \enumht);
\fill[enumcolor!30] (o) -- +(\enumht, 0) arc[radius=\enumht, start angle=0, end angle=90] -- cycle;
\fill[white] (o) circle (.6em);
\node[
anchor=center,
font=\fontfamily{qhv}\fontsize{6}{6}\selectfont\bfseries\color{enumcolor},
xshift=.25pt,
] (num) at (o) {\ifnum#1<10\relax 0#1\else#1\fi};
\end{tikzpicture}%
}
\begin{document}
\begin{multicols}{3}
\begin{enumerate}[label=\protect\blpt{\arabic*}]
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\item abcdefg
\end{enumerate}
\end{multicols}
\end{document}