Add user color blind option
This commit is contained in:
parent
4aeaa580ea
commit
63191dab7d
@ -96,7 +96,7 @@ class DolGraph
|
||||
*/
|
||||
public function __construct($library = 'jflot')
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $user;
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor;
|
||||
|
||||
// To use old feature
|
||||
|
||||
@ -958,7 +958,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false)
|
||||
print '<td colspan="'.($colspan-1).'">';
|
||||
|
||||
$colorBlindOptions = array(
|
||||
'none' => $langs->trans('No'),
|
||||
0 => $langs->trans('No'),
|
||||
'protanopia' => $langs->trans('Protanopia'),
|
||||
'deuteranopes' => $langs->trans('Deuteranopes'),
|
||||
'tritanopes' => $langs->trans('Tritanopes'),
|
||||
|
||||
@ -30,9 +30,14 @@
|
||||
* if (is_readable($var_file)) include $var_file;
|
||||
*/
|
||||
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet, $user;
|
||||
$theme_bordercolor = array(235,235,224);
|
||||
$theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250,190,30), array(221, 75, 57), array(0,166,90), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
|
||||
if(!empty($user) && !empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by graph
|
||||
{
|
||||
// for now we use the same configuration for all types of color blind
|
||||
$theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(120,120,120), array(253, 205, 102), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
|
||||
}
|
||||
|
||||
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
|
||||
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user