# \cellcolor is taking too much space in a matrix

I would like to highlight a row, a column and a specific cell in a matrix. I ended up using \cellcolor. My problem is that \cellcolor is taking too much space, therefore the matrix borders are being covered by the color. As you see in the below picture how the matrix is ruined by the color

and this is my code

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[table]{xcolor}

\begin{document}

\begin{align*}
\begin{bmatrix}
\cellcolor{green} ss &  \cellcolor{red!80} ss \\
\cellcolor{green} ss &  \cellcolor{red!80} ss \\
\end{bmatrix}
\end{align*}

\end{document}


In this case you may be better off using a traditional array construction:

\documentclass{article}
%\usepackage{amsmath}
\usepackage[table]{xcolor}

\begin{document}

$\left[\,\begin{array}{cc} \cellcolor{green} ss & \cellcolor{red!80} ss \\ \cellcolor{green} ss & \cellcolor{red!80} ss \\ \end{array}\,\right]$

\end{document}


If all the cells belonging to the same columns have the same color, with array you can specify the color of the column directly, without resorting to \cellcolor for each cell.

\documentclass{article}
%\usepackage{amsmath}
\usepackage[table]{xcolor}

\begin{document}

$\left[\, \begin{array}{>{\columncolor{green}}c >{\columncolor{red!80}}c} ss & ss \\ ss & ss \\ \end{array}\, \right]$

\end{document}


Output