diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php
index 8412bbcd6..533acf863 100644
--- a/views/bootstrap/class.Bootstrap.php
+++ b/views/bootstrap/class.Bootstrap.php
@@ -3089,8 +3089,9 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
if($categories = $document->getCategories()) {
$content .= "
";
- foreach($categories as $category)
- $content .= "getColor() ? ' style="background-color: '.$category->getColor().' !important;"' : '').">".$category->getName()." ";
+ foreach($categories as $category) {
+ $content .= "getColor() ? ' style="background-color: '.$category->getColor().' !important; color: '.(getColorBrightness($category->getColor()) < 0.8 ? 'white' : 'black').';"' : '').">".$category->getName()." ";
+ }
}
if(!empty($extracontent['bottom_title']))
$content .= $extracontent['bottom_title'];