1

Given the answer here, I made the following modification:

\documentclass[10pt]{article}

\usepackage{graphicx}
\usepackage[x11names,svgnames,dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}

\usepackage[tikz]{bclogo}
\usetikzlibrary{calc}
\usetikzlibrary{shapes}
\usetikzlibrary{fadings}

\usepackage{blindtext}
\usepackage{XCharter}
\usepackage[T1]{fontenc}

    \newtcolorbox{recyclebox}[2][]{%
      breakable,
      enhanced jigsaw,
      coltitle={recyclecolor!300},
      fonttitle={\bfseries\large},
      title={\MakeUppercase{Recycle!}},
      attach title to upper={{~\itshape\bfseries\large #2}\par},
      colframe=recyclecolor!300,
      colback=recyclecolor!03,
      interior style={left color=recyclecolor!30, right color=recyclecolor!30,middle color=recyclecolor!10},
      overlay={%
        \draw[recyclecolor,line width=1.5pt,fill=recyclecolor!30,] ($(interior.north west) + (-0.02pt,-1cm)$) arc [start angle=90,end angle=270,radius=0.5cm] node[midway] (dottedcircle) {};
        \foreach \x in {1,...,12} {%
          \draw[fill,opacity=1.0*(\x/12),recyclecolor] ($(dottedcircle)+ (0.5cm-0.02pt,0)+(120+\x*30:0.3cm)$) circle (0.04cm);
        };
      },
      #1%
    }

\begin{document}


\begin{recyclebox}{There is and There are}
\blindtext
\end{recyclebox}


\end{document}

I'm trying to darken the dots and part of the edge which is still not darkened. How can I fix it?

  • 2
    As usual, please prove a complete code example and not just a fragment... – Dr. Manuel Kuehner Apr 4 '17 at 0:19
  • @Dr.ManuelKuehner Okay. Now it's complete. – Alejandro Apr 4 '17 at 2:38
  • @Ustanak: Using something like inner color=blue,outer color=yellow inside of interior style will provide you with a radial shading – user31729 Apr 4 '17 at 3:28
8

This is some make over of my answer to the other question, I applied a radial shading here.

\documentclass[10pt]{article}

\usepackage{blindtext}
\usepackage{XCharter}
\usepackage[T1]{fontenc}

\usepackage{graphicx}
\usepackage[x11names,svgnames,dvipsnames]{xcolor}
\usepackage[tikz]{bclogo}
\usetikzlibrary{calc}
\usetikzlibrary{shapes}

\usepackage[most]{tcolorbox}

\definecolor{recyclecolor}{RGB}{255,128,50}

\makeatletter

\tcbset{%
  decoration downshift/.store in={\decoration@downshift},
  decoration radius/.store in={\decoration@radius},
  decoration recycle radius/.store in={\decoration@recyclecircleradius},
  decoration dot radius/.store in={\decoration@dotradius},
  decoration content/.store in={\decoration@content},
  decoration colour/.store in={\decoration@colour},
}

\tcbset{recyclebox/.style={decoration radius=0.5cm,decoration downshift=-0.5cm}}

\tcbset{learnthisbox/.style={%
    decoration radius=0.5cm,
    decoration downshift=-0.5cm,
    decoration content={\bclampe},
    decoration colour=blue}
}


\newtcolorbox{recyclebox}[2][]{%
  recyclebox,
  decoration recycle radius={0.6*\decoration@radius},
  decoration dot radius={0.04*\decoration@radius},
  decoration colour=recyclecolor,
  breakable,
  enhanced jigsaw,
  leftrule=1.5pt,
  fonttitle={\bfseries\large},
  title={\MakeUppercase{Recycle!}},
  #1,
  attach title to upper={{~\itshape\bfseries\large #2}\par},
  interior style={shading=radial,inner color=tcbcol@back!0,outer color=tcbcol@back},
  underlay unbroken and first={%
    \draw[tcbcol@frame,line width=\kvtcb@left@rule,fill=tcbcol@back] ($(frame.north west) + (\kvtcb@left@rule-0.03pt,\decoration@downshift)$) arc [start angle=90.0,end angle=270.0,radius=\decoration@radius] node[midway,inner sep=0pt] (dottedcircle) {};
    \foreach \x in {1,...,12} {%
      \draw[fill=tcbcol@back,opacity=4*(\x/12),tcbcol@frame] ($(dottedcircle) + (\decoration@radius,0cm)+(120+\x*30:\decoration@recyclecircleradius)$) circle (\decoration@dotradius);
    };
  },
  colframe={\decoration@colour},
  colback={tcbcol@frame!60},
  coltitle={tcbcol@frame!100},
}


\newtcolorbox{learnthis}[2][]{%
  learnthisbox,
  breakable,
  enhanced jigsaw,
  leftrule=1.5pt,
  fonttitle={\bfseries\large},
  title={\MakeUppercase{Learn This!}},
  attach title to upper={{~\bfseries\large #2} \par},
  #1,
  interior style={inner color=tcbcol@back!0!white,outer color=tcbcol@back!100},
  underlay unbroken and first={%
    \draw[tcbcol@frame,line width=\kvtcb@left@rule,fill=tcbcol@back] ($(frame.north west) + (\kvtcb@left@rule-0.03pt,\decoration@downshift)$) arc [start angle=90.0,end angle=270.0,radius=\decoration@radius] node[midway,right] (dottedcircle) {\decoration@content};
  },
  % Something to be set after #1 has been read!
  colframe=\decoration@colour,
  colback=\decoration@colour!30,
  coltitle={tcbcol@frame},
}

\makeatother




\begin{document}

\begin{learnthis}[decoration content={\bccrayon}]{Past Tense}
\blindtext
\end{learnthis}


\begin{learnthis}[decoration colour=green]{Past Tense}
\blindtext
\end{learnthis}


\begin{recyclebox}[decoration radius={0.4cm},decoration dot radius=0.03cm]{There is and There are}
\blindtext[1]
\end{recyclebox}


\end{document}

enter image description here

  • 1
    Impressive what the tcolorbox package (and Christian) can achieve! So is decoration dot radius and friend already pre-defined? – Dr. Manuel Kuehner Apr 4 '17 at 11:00
  • 1
    @Dr.ManuelKuehner: It's tcolorbox and Tikz, Christian only glues strange examples together ;-) No, decoration .... are new pgfkeys. And I should rename them actually to prevent accidental errors with the decorations library from TikZ ;-) – user31729 Apr 4 '17 at 11:04
  • 1
    @ChristianHupfer Your recycling symbol could be an interesting answer for tex.stackexchange.com/questions/369254/… – user36296 Jun 4 '17 at 21:37
  • @samcarter: Well, thanks, I will think about it! – user31729 Jun 4 '17 at 21:39
  • @ChristianHupfer Excellent work that i will use into my work. +1 – Sebastiano Jun 5 '17 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.