# Colored and inclined boxes

I would like to get the following colored boxes so that they are also slightly inclined. Here is a picture of what it should look like

Can someone tell me how to do this with latex? Which packages do you have to use for this? Thank you in advance

You can use tcolorbox:

\documentclass{article}
\usepackage[most]{tcolorbox}

\newtcbox{mybox}[2]{
enhanced,
frame hidden,
colback=#2,
arc=2pt,
tikz={rotate=#1,transform shape},
nobeforeafter}

\begin{document}

\mybox{15}{red!40}{$f_1(x) = x^4 - 3x^2 + 1$}
\mybox{-10}{yellow!40}{$f_2(x) = x^2 - 3$}

\end{document}


The solution by @user187803 using tcolorbox is probably the right way to do this, especially is you want the fuzzy shadow. For variety, here is a TikZ solution using drop shadow.

\usepackage[dvipsnames]{xcolor} is unnecessary, but allows the use of fun color names.

\documentclass{article}

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}

\newcommand{\colbox}[3]{\tikz{\node[fill=#1,rotate=#2,inner sep=2mm,
drop shadow]{$#3$}}}

\begin{document}