-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDarkTheme.php
More file actions
75 lines (64 loc) · 2.4 KB
/
DarkTheme.php
File metadata and controls
75 lines (64 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* Piwik - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\DarkTheme;
use Piwik\Plugin;
class DarkTheme extends Plugin
{
public function registerEvents()
{
return [
'Theme.configureThemeVariables' => 'configureThemeVariables',
];
}
public function configureThemeVariables(Plugin\ThemeStyles $vars)
{
// Primary colors
$primary = '#4a6fc7';
$primaryLight = '#6b8fd9';
$primaryDark = '#3450a3';
// Dark scale
$darkest = '#181a1f';
$darker = '#202329';
$dark = '#2b3138';
$darkElevated = '#3a424d';
// Light scale
$light = '#ffffff';
$lightMuted = 'rgba(255, 255, 255, 0.85)';
$lightTransparent = 'rgba(255, 255, 255, 0.7)';
$lightSubtle = 'rgba(255, 255, 255, 0.5)';
$vars->colorBrand = $primary;
$vars->colorBrandContrast = $light;
$vars->colorText = '#212121'; // Email text color (dark for white email backgrounds)
$vars->colorTextLight = '#444444'; // Email secondary text
$vars->colorTextLighter = '#666666'; // Email tertiary text
$vars->colorTextContrast = $light;
$vars->colorLink = $primaryLight;
$vars->colorBaseSeries = '#ee3024';
$vars->colorHeadlineAlternative = $lightTransparent;
$vars->colorHeaderBackground = $dark;
$vars->colorHeaderText = $light;
$vars->colorMenuContrastText = $lightTransparent;
$vars->colorMenuContrastTextSelected = $primaryLight;
$vars->colorMenuContrastTextActive = $light;
$vars->colorMenuContrastBackground = 'transparent';
$vars->colorWidgetBorder = $darkElevated;
$vars->colorWidgetBackground = $dark;
$vars->colorWidgetExportedBackgroundBase = $dark;
$vars->colorWidgetTitleBackground = $dark; // Same as widget body
$vars->colorWidgetTitleText = $light;
$vars->colorBackgroundBase = $darker;
$vars->colorBackgroundTinyContrast = $darkElevated;
$vars->colorBackgroundLowContrast = $dark;
$vars->colorBackgroundContrast = $dark;
$vars->colorBackgroundHighContrast = $darkest;
$vars->colorBorder = $darkElevated;
$vars->colorCode = $lightMuted;
$vars->colorCodeBackground = $darkElevated;
}
}