Fix illegible text color in columns Size and Modified on dark theme

Signed-off-by: Alexey Pyltsyn <lex61rus@gmail.com>
This commit is contained in:
Alexey Pyltsyn 2018-10-14 14:48:39 +03:00
parent 0fca815b4d
commit 5911367a18
2 changed files with 15 additions and 0 deletions

View File

@ -1384,6 +1384,10 @@
// rgb(118, 118, 118) / #767676 // rgb(118, 118, 118) / #767676
// min. color contrast for normal text on white background according to WCAG AA // min. color contrast for normal text on white background according to WCAG AA
sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)),2)); sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)),2));
if (oc_defaults.themeName === 'themedark') {
sizeColor = Math.abs(sizeColor);
}
} else { } else {
simpleSize = t('files', 'Pending'); simpleSize = t('files', 'Pending');
} }
@ -1403,6 +1407,16 @@
if (modifiedColor >= '118') { if (modifiedColor >= '118') {
modifiedColor = 118; modifiedColor = 118;
} }
if (oc_defaults.themeName === 'themedark') {
modifiedColor = Math.abs(modifiedColor);
// ensure that the dimmest color is still readable
// rgb(130, 130, 130) / #828282
// min. color contrast for normal text on black background according to WCAG AA
if (modifiedColor < 130) {
modifiedColor = 130;
}
}
var formatted; var formatted;
var text; var text;
if (mtime > 0) { if (mtime > 0) {

View File

@ -260,6 +260,7 @@ class JSConfigHelper {
'shortFooter' => $this->defaults->getShortFooter(), 'shortFooter' => $this->defaults->getShortFooter(),
'longFooter' => $this->defaults->getLongFooter(), 'longFooter' => $this->defaults->getLongFooter(),
'folder' => \OC_Util::getTheme(), 'folder' => \OC_Util::getTheme(),
'themeName' => $this->config->getUserValue($uid, 'accessibility', 'theme', false),
]), ]),
"oc_capabilities" => json_encode($capabilities), "oc_capabilities" => json_encode($capabilities),
]; ];