\usepackage {color} \definecolor{Light}{gray}{.80} \definecolor{Dark}{gray}{.20} \colorbox{red}{Black text on red background} \par\colorbox{Light}{% \textcolor{Dark}{Light background}} \par\colorbox{Dark}{% \textcolor{white}{Dark background}}